From 188b984c451660780d0669dbfcc84dfdd3aa3b8e Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 21 Nov 2003 15:28:25 +0000 Subject: [PATCH] bitkeeper revision 1.625 (3fbe2f19esMEVaXjNmogxfluk2JD7Q) xi_stopdom.py, xi_listdoms.py, xi_destroydom.py, xi_createlinuxdom.py: new file Makefile, Xc.c, xen_cpuperf.c, Xeno-HOWTO: Create example Python control scripts in tools/misc. Delete obsolete tools/control and tools/internal. Update docs. .del-info.c~f4ad8e683fe1d35: Delete: xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c .del-xi_vifinit~38149940dad8e67a: Delete: tools/internal/xi_vifinit .del-xi_vif_params.c~9151f057c314cf7a: Delete: tools/internal/xi_vif_params.c .del-xi_vbd_list.c~84922f92e6a6262e: Delete: tools/internal/xi_vbd_list.c .del-xi_vbd_info.c~981a992ecde72f50: Delete: tools/internal/xi_vbd_info.c .del-xi_vbd_create.c~f1118f53d74c555: Delete: tools/internal/xi_vbd_create.c .del-xi_vbd_add.c~a6d831ecbe015a9d: Delete: tools/internal/xi_vbd_add.c .del-xi_usage.c~68391a152ead20c: Delete: tools/internal/xi_usage.c .del-xi_stop.c~4ef370f18cb74cea: Delete: tools/internal/xi_stop.c .del-xi_start.c~b4656af7bfebd0eb: Delete: tools/internal/xi_start.c .del-xi_sched_global.c~bb19c1a0c457e08a: Delete: tools/internal/xi_sched_global.c .del-xi_sched_domain.c~7ed340cd41ae5b33: Delete: tools/internal/xi_sched_domain.c .del-xi_save_linux.c~15e91079dc6e1f52: Delete: tools/internal/xi_save_linux.c .del-xi_restore_linux.c~cd9f16a3dab69aee: Delete: tools/internal/xi_restore_linux.c .del-xi_read_console_ring.c~687b0bcae18cb1af: Delete: tools/internal/xi_read_console_ring.c .del-xi_phys_grant.c~422d8487936fa4c9: Delete: tools/internal/xi_phys_grant.c .del-xi_list.c~339a2f98db3a4b1f: Delete: tools/internal/xi_list.c .del-xi_helper~5d8f529425dd50f8: Delete: tools/internal/xi_helper .del-xi_destroy.c~44069345187b985d: Delete: tools/internal/xi_destroy.c .del-xi_create.c~9013eff27664db4b: Delete: tools/internal/xi_create.c .del-xi_build.c~55e0f7994dbfebdf: Delete: tools/internal/xi_build.c .del-rpm.spec~73ab630afebd3adc: Delete: tools/internal/rpm.spec .del-mem_defs.h~a42f0035e2bc6841: Delete: tools/internal/mem_defs.h .del-dom0_defs.h~8faf8b626237a755: Delete: tools/internal/dom0_defs.h .del-Makefile~f6522b0feb91f984: Delete: tools/internal/Makefile .del-xenostyle.css~6f6fdfdc625f6ba9: Delete: tools/control/web/tmpl/xenostyle.css .del-xenohead.def~75d33f086d74ed73: Delete: tools/control/web/tmpl/xenohead.def .del-xenofoot.def~7822ea1cb20d0bf: Delete: tools/control/web/tmpl/xenofoot.def .del-vdmenu.tmpl~a9affd2660773ba7: Delete: tools/control/web/tmpl/vdmenu.tmpl .del-vd.tmpl~8d64c39cb07c847c: Delete: tools/control/web/tmpl/vd.tmpl .del-vd-vdv.tmpl~6ce2247b5dd6fa71: Delete: tools/control/web/tmpl/vd-vdv.tmpl .del-xeno.gif~87337600f0e4b6cb: Delete: tools/control/web/img/xeno.gif .del-vd-vdrr.tmpl~f62e0e4cbbcaa21f: Delete: tools/control/web/tmpl/vd-vdrr.tmpl .del-vd-vdr.tmpl~bc166849e09d680a: Delete: tools/control/web/tmpl/vd-vdr.tmpl .del-vd-vddr.tmpl~a9305c17b49ed0a: Delete: tools/control/web/tmpl/vd-vddr.tmpl .del-vd-vdd.tmpl~a87ab77c787ebee2: Delete: tools/control/web/tmpl/vd-vdd.tmpl .del-vd-vdcr.tmpl~6cdd100a5a385284: Delete: tools/control/web/tmpl/vd-vdcr.tmpl .del-vd-vdc.tmpl~f564ab29c2ed6c51: Delete: tools/control/web/tmpl/vd-vdc.tmpl .del-vd-vbdv.tmpl~502df49e757bd832: Delete: tools/control/web/tmpl/vd-vbdv.tmpl .del-vd-vbdcr.tmpl~4011e8874a4d4580: Delete: tools/control/web/tmpl/vd-vbdcr.tmpl .del-vd-vbdc.tmpl~ea2620f4acddc499: Delete: tools/control/web/tmpl/vd-vbdc.tmpl .del-vd-pv.tmpl~7c15c3f2889c19: Delete: tools/control/web/tmpl/vd-pv.tmpl .del-vd-par.tmpl~6a9c1adf4255c1f4: Delete: tools/control/web/tmpl/vd-par.tmpl .del-vd-pa.tmpl~cfc3c39bbee289df: Delete: tools/control/web/tmpl/vd-pa.tmpl .del-vd-fv.tmpl~e7bf7c7f6b172cae: Delete: tools/control/web/tmpl/vd-fv.tmpl .del-search.gif~12f79a986fb9402c: Delete: tools/control/web/img/search.gif .del-pdmenu.tmpl~1e7bff9523b0bbaa: Delete: tools/control/web/tmpl/pdmenu.tmpl .del-pd.tmpl~8c5c232c132bcb13: Delete: tools/control/web/tmpl/pd.tmpl .del-pd-rr.tmpl~2f563e846bc965b5: Delete: tools/control/web/tmpl/pd-rr.tmpl .del-pd-r.tmpl~ee36df10225d67d9: Delete: tools/control/web/tmpl/pd-r.tmpl .del-pd-l.tmpl~acd063974b95504: Delete: tools/control/web/tmpl/pd-l.tmpl .del-pd-gr.tmpl~cca1c9a19939db70: Delete: tools/control/web/tmpl/pd-gr.tmpl .del-pd-g.tmpl~6983193813a3f098: Delete: tools/control/web/tmpl/pd-g.tmpl .del-makefile~32e72e0a58a71587: Delete: tools/control/web/tmpl/makefile .del-install.pl~bf0f10a96268eec: Delete: tools/control/web/tmpl/install.pl .del-index.tmpl~a9f5536b736b2bee: Delete: tools/control/web/tmpl/index.tmpl .del-help.tmpl~a8c78cf6aa63ca4d: Delete: tools/control/web/tmpl/help.tmpl .del-dommenu.tmpl~dcdecbc2f2bcf2df: Delete: tools/control/web/tmpl/dommenu.tmpl .del-dom.tmpl~4bb3289ae71d2f63: Delete: tools/control/web/tmpl/dom.tmpl .del-dom-stpr.tmpl~5469b499f28a24fe: Delete: tools/control/web/tmpl/dom-stpr.tmpl .del-dom-stp.tmpl~aa087fed3e776059: Delete: tools/control/web/tmpl/dom-stp.tmpl .del-dom-star.tmpl~c1e511d2e6e039bf: Delete: tools/control/web/tmpl/dom-star.tmpl .del-dom-sta.tmpl~eec4c966e27825ee: Delete: tools/control/web/tmpl/dom-sta.tmpl .del-dom-newr.tmpl~3f837ebfec8319a8: Delete: tools/control/web/tmpl/dom-newr.tmpl .del-dom-new.tmpl~6fe1462b95a26d5f: Delete: tools/control/web/tmpl/dom-new.tmpl .del-dom-lis.tmpl~85face7aa9811ee6: Delete: tools/control/web/tmpl/dom-lis.tmpl .del-dom-delr.tmpl~b0f4e92c66323471: Delete: tools/control/web/tmpl/dom-delr.tmpl .del-dom-del.tmpl~22452a94642dee59: Delete: tools/control/web/tmpl/dom-del.tmpl .del-about.tmpl~e55c75ae7d40f51d: Delete: tools/control/web/tmpl/about.tmpl .del-web.xml~d3569e2740475560: Delete: tools/control/web/WEB-INF/web.xml .del-pixel.gif~1c70dff3f6408bdd: Delete: tools/control/web/img/pixel.gif .del-home.gif~59d99d5348b498ac: Delete: tools/control/web/img/home.gif .del-help.gif~c2b5bbf58ecda4a5: Delete: tools/control/web/img/help.gif .del-cambridge.gif~31322a41ad46112: Delete: tools/control/web/img/cambridge.gif .del-XMLHelper.java~1ae486474964f9c3: Delete: tools/control/src/org/xenoserver/control/XMLHelper.java .del-XML.java~ede5498f3e107f1f: Delete: tools/control/src/org/xenoserver/control/XML.java .del-VirtualDiskManager.java~ab196de56ed40de1: Delete: tools/control/src/org/xenoserver/control/VirtualDiskManager.java .del-VirtualDisk.java~fafbe80750ab42e2: Delete: tools/control/src/org/xenoserver/control/VirtualDisk.java .del-VirtualBlockDevice.java~98092b4ad4e7bacd: Delete: tools/control/src/org/xenoserver/control/VirtualBlockDevice.java .del-SystemConfigurationBean.java~6fef72e1e39f275f: Delete: tools/control/src/org/xenoserver/web/SystemConfigurationBean.java .del-StringPattern.java~5315ee9851c204fe: Delete: tools/control/src/org/xenoserver/control/StringPattern.java .del-Settings.java~204154059ef7137a: Delete: tools/control/src/org/xenoserver/control/Settings.java .del-RootBean.java~51ad233a3a388d8a: Delete: tools/control/src/org/xenoserver/web/RootBean.java .del-PartitionManager.java~3de50829f63194f9: Delete: tools/control/src/org/xenoserver/control/PartitionManager.java .del-Partition.java~cf021656a42a020d: Delete: tools/control/src/org/xenoserver/control/Partition.java .del-ParseVdShow.java~9775d252c7b15110: Delete: tools/control/src/org/xenoserver/cmdline/ParseVdShow.java .del-Mode.java~25b8442d604135a2: Delete: tools/control/src/org/xenoserver/control/Mode.java .del-Library.java~1bdf383c73b9d30: Delete: tools/control/src/org/xenoserver/control/Library.java .del-InetAddressPattern.java~c8ab0e21763bb46: Delete: tools/control/src/org/xenoserver/control/InetAddressPattern.java .del-Extent.java~e2aacb058cf387dd: Delete: tools/control/src/org/xenoserver/control/Extent.java .del-Domain.java~2c9322038df8d5b0: Delete: tools/control/src/org/xenoserver/control/Domain.java .del-Defaults.java~a20e2ae2fdb4199: Delete: tools/control/src/org/xenoserver/control/Defaults.java .del-CommandVdRefresh.java~b561605ea2bb7663: Delete: tools/control/src/org/xenoserver/control/CommandVdRefresh.java .del-CommandVdDelete.java~1f1433ded35ec0e4: Delete: tools/control/src/org/xenoserver/control/CommandVdDelete.java .del-CommandVdCreate.java~eabf64408bfece75: Delete: tools/control/src/org/xenoserver/control/CommandVdCreate.java .del-CommandVbdList.java~c4b4a0a56d5c159b: Delete: tools/control/src/org/xenoserver/control/CommandVbdList.java .del-CommandVbdCreatePhysical.java~acddd9a8f3934603: Delete: tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java .del-CommandVbdCreate.java~cab25ef9c2f9efa0: Delete: tools/control/src/org/xenoserver/control/CommandVbdCreate.java .del-CommandPhysicalRevoke.java~19984f49205247ee: Delete: tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java .del-CommandPhysicalList.java~40e08514cd0288bd: Delete: tools/control/src/org/xenoserver/control/CommandPhysicalList.java .del-CommandPhysicalGrant.java~62fb80a3494e789a: Delete: tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java .del-CommandPartitionAdd.java~e7fcb3cea1f79648: Delete: tools/control/src/org/xenoserver/control/CommandPartitionAdd.java .del-CommandFailedException.java~cf05d4045a3ab73f: Delete: tools/control/src/org/xenoserver/control/CommandFailedException.java .del-CommandDomainStop.java~57fbc199fddf8b7d: Delete: tools/control/src/org/xenoserver/control/CommandDomainStop.java .del-CommandDomainStart.java~d24ceda9ec764887: Delete: tools/control/src/org/xenoserver/control/CommandDomainStart.java .del-CommandDomainNew.java~8a31b25dd21356d4: Delete: tools/control/src/org/xenoserver/control/CommandDomainNew.java .del-CommandDomainList.java~831c2cbb36df1829: Delete: tools/control/src/org/xenoserver/control/CommandDomainList.java .del-CommandDomainDestroy.java~858175208c48ee8d: Delete: tools/control/src/org/xenoserver/control/CommandDomainDestroy.java .del-Command.java~c45623cf89aa911f: Delete: tools/control/src/org/xenoserver/control/Command.java .del-xenctl~d6d1ced69a4edb06: Delete: tools/control/xenctl .del-xenctl.xml~dbcf47dd62a4c874: Delete: tools/control/examples/xenctl.xml .del-xenctl.xml-publicip~c1dc0c0c01bae47: Delete: tools/control/examples/xenctl.xml-publicip .del-xenctl.xml-linklocal~ac50b907d93dde62: Delete: tools/control/examples/xenctl.xml-linklocal .del-xenctl.xml-dom0nfs~2d4bfd30420f37c: Delete: tools/control/examples/xenctl.xml-dom0nfs .del-xen-mynewdom~eb9eb7ccaba10ea6: Delete: tools/control/examples/xen-mynewdom .del-grub.conf-example~ffdd191a69572347: Delete: tools/control/examples/grub.conf-example .del-etc.exports-example~e109d7d96ace82d5: Delete: tools/control/examples/etc.exports-example .del-build.properties~a26cad6e308b460d: Delete: tools/control/build.properties .del-build-web.xml~65af6961ad5a0006: Delete: tools/control/build-web.xml .del-build-cmdline.xml~90a4e63cd116d260: Delete: tools/control/build-cmdline.xml .del-USAGE-cmdline~a07f39f14fa71021: Delete: tools/control/doc/USAGE-cmdline .del-ParseVdRefresh.java~52d3c19fba954349: Delete: tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java .del-ParseVdFree.java~736eae32c0439aef: Delete: tools/control/src/org/xenoserver/cmdline/ParseVdFree.java .del-ParseVdDelete.java~1be4ea2ea5ce7030: Delete: tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java .del-ParseVdCreate.java~28ee263e4872c2a: Delete: tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java .del-ParseVbdShow.java~bd36e5a695e124de: Delete: tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java .del-ParseVbdCreate.java~7d6abfe7b735916f: Delete: tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java .del-ParseScript.java~5137d45494c175f4: Delete: tools/control/src/org/xenoserver/cmdline/ParseScript.java .del-ParsePhysicalRevoke.java~6b0265c5134872be: Delete: tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java .del-ParsePhysicalList.java~c42cd53f66a8cbfa: Delete: tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java .del-ParsePhysicalGrant.java~453f27fc4b20a519: Delete: tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java .del-ParsePartitionsList.java~2cfe6d2f93711838: Delete: tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java .del-ParsePartitionsAdd.java~2869522f1c6258b1: Delete: tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java .del-ParseHelp.java~d81805b2b35e7f8b: Delete: tools/control/src/org/xenoserver/cmdline/ParseHelp.java .del-ParseGroup.java~9dca3029634c4c7: Delete: tools/control/src/org/xenoserver/cmdline/ParseGroup.java .del-ParseFailedException.java~448f60dd7ec604b: Delete: tools/control/src/org/xenoserver/cmdline/ParseFailedException.java .del-ParseDomainStop.java~8a22aa198436278f: Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java .del-ParseDomainStart.java~eb406fd143d938f1: Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java .del-ParseDomainNew.java~1753e1f7b4942b: Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java .del-ParseDomainList.java~170d7622789247bb: Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainList.java .del-ParseDomainDestroy.java~3b2639c66f4c1fb: Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java .del-Makefile~8c5f335db8a47ad3: Delete: tools/control/Makefile .del-Main.java~72e3e9e28ef6446a: Delete: tools/control/src/org/xenoserver/cmdline/Main.java .del-INSTALL-web~96f8752b9fcd6dae: Delete: tools/control/doc/INSTALL-web .del-INSTALL-cmdline~73e6d06a3262dcea: Delete: tools/control/doc/INSTALL-cmdline .del-CommandParser.java~534cced2be48ac9d: Delete: tools/control/src/org/xenoserver/cmdline/CommandParser.java --- .rootkeys | 150 +---- docs/Xeno-HOWTO | 117 ++-- tools/Makefile | 6 - tools/control/Makefile | 39 -- tools/control/build-cmdline.xml | 50 -- tools/control/build-web.xml | 477 ---------------- tools/control/build.properties | 7 - tools/control/doc/INSTALL-cmdline | 14 - tools/control/doc/INSTALL-web | 50 -- tools/control/doc/USAGE-cmdline | 97 ---- tools/control/examples/etc.exports-example | 20 - tools/control/examples/grub.conf-example | 48 -- tools/control/examples/xen-mynewdom | 3 - tools/control/examples/xenctl.xml | 17 - tools/control/examples/xenctl.xml-dom0nfs | 17 - tools/control/examples/xenctl.xml-linklocal | 17 - tools/control/examples/xenctl.xml-publicip | 17 - .../org/xenoserver/cmdline/CommandParser.java | 142 ----- .../src/org/xenoserver/cmdline/Main.java | 103 ---- .../cmdline/ParseDomainDestroy.java | 36 -- .../xenoserver/cmdline/ParseDomainList.java | 44 -- .../xenoserver/cmdline/ParseDomainNew.java | 124 ----- .../xenoserver/cmdline/ParseDomainStart.java | 34 -- .../xenoserver/cmdline/ParseDomainStop.java | 34 -- .../cmdline/ParseFailedException.java | 14 - .../org/xenoserver/cmdline/ParseGroup.java | 94 ---- .../src/org/xenoserver/cmdline/ParseHelp.java | 31 -- .../cmdline/ParsePartitionsAdd.java | 43 -- .../cmdline/ParsePartitionsList.java | 65 --- .../cmdline/ParsePhysicalGrant.java | 56 -- .../xenoserver/cmdline/ParsePhysicalList.java | 94 ---- .../cmdline/ParsePhysicalRevoke.java | 43 -- .../org/xenoserver/cmdline/ParseScript.java | 79 --- .../xenoserver/cmdline/ParseVbdCreate.java | 63 --- .../org/xenoserver/cmdline/ParseVbdShow.java | 41 -- .../org/xenoserver/cmdline/ParseVdCreate.java | 60 -- .../org/xenoserver/cmdline/ParseVdDelete.java | 40 -- .../org/xenoserver/cmdline/ParseVdFree.java | 55 -- .../xenoserver/cmdline/ParseVdRefresh.java | 53 -- .../org/xenoserver/cmdline/ParseVdShow.java | 70 --- .../src/org/xenoserver/control/Command.java | 44 -- .../control/CommandDomainDestroy.java | 68 --- .../xenoserver/control/CommandDomainList.java | 121 ---- .../xenoserver/control/CommandDomainNew.java | 413 -------------- .../control/CommandDomainStart.java | 58 -- .../xenoserver/control/CommandDomainStop.java | 59 -- .../control/CommandFailedException.java | 41 -- .../control/CommandPartitionAdd.java | 49 -- .../control/CommandPhysicalGrant.java | 105 ---- .../control/CommandPhysicalList.java | 119 ---- .../control/CommandPhysicalRevoke.java | 77 --- .../xenoserver/control/CommandVbdCreate.java | 69 --- .../control/CommandVbdCreatePhysical.java | 81 --- .../xenoserver/control/CommandVbdList.java | 66 --- .../xenoserver/control/CommandVdCreate.java | 42 -- .../xenoserver/control/CommandVdDelete.java | 43 -- .../xenoserver/control/CommandVdRefresh.java | 35 -- .../src/org/xenoserver/control/Defaults.java | 246 -------- .../src/org/xenoserver/control/Domain.java | 42 -- .../src/org/xenoserver/control/Extent.java | 88 --- .../control/InetAddressPattern.java | 79 --- .../src/org/xenoserver/control/Library.java | 148 ----- .../src/org/xenoserver/control/Mode.java | 36 -- .../src/org/xenoserver/control/Partition.java | 200 ------- .../xenoserver/control/PartitionManager.java | 171 ------ .../src/org/xenoserver/control/Settings.java | 63 --- .../org/xenoserver/control/StringPattern.java | 78 --- .../control/VirtualBlockDevice.java | 67 --- .../org/xenoserver/control/VirtualDisk.java | 236 -------- .../control/VirtualDiskManager.java | 157 ------ .../src/org/xenoserver/control/XML.java | 120 ---- .../src/org/xenoserver/control/XMLHelper.java | 186 ------- .../src/org/xenoserver/web/RootBean.java | 45 -- .../web/SystemConfigurationBean.java | 20 - tools/control/web/WEB-INF/web.xml | 20 - tools/control/web/img/cambridge.gif | Bin 1733 -> 0 bytes tools/control/web/img/help.gif | Bin 243 -> 0 bytes tools/control/web/img/home.gif | Bin 244 -> 0 bytes tools/control/web/img/pixel.gif | Bin 43 -> 0 bytes tools/control/web/img/search.gif | Bin 272 -> 0 bytes tools/control/web/img/xeno.gif | Bin 3600 -> 0 bytes tools/control/web/tmpl/about.tmpl | 71 --- tools/control/web/tmpl/dom-del.tmpl | 96 ---- tools/control/web/tmpl/dom-delr.tmpl | 50 -- tools/control/web/tmpl/dom-lis.tmpl | 58 -- tools/control/web/tmpl/dom-new.tmpl | 197 ------- tools/control/web/tmpl/dom-newr.tmpl | 113 ---- tools/control/web/tmpl/dom-sta.tmpl | 73 --- tools/control/web/tmpl/dom-star.tmpl | 48 -- tools/control/web/tmpl/dom-stp.tmpl | 73 --- tools/control/web/tmpl/dom-stpr.tmpl | 48 -- tools/control/web/tmpl/dom.tmpl | 30 - tools/control/web/tmpl/dommenu.tmpl | 33 -- tools/control/web/tmpl/help.tmpl | 61 -- tools/control/web/tmpl/index.tmpl | 67 --- tools/control/web/tmpl/install.pl | 236 -------- tools/control/web/tmpl/makefile | 41 -- tools/control/web/tmpl/pd-g.tmpl | 99 ---- tools/control/web/tmpl/pd-gr.tmpl | 77 --- tools/control/web/tmpl/pd-l.tmpl | 90 --- tools/control/web/tmpl/pd-r.tmpl | 104 ---- tools/control/web/tmpl/pd-rr.tmpl | 50 -- tools/control/web/tmpl/pd.tmpl | 24 - tools/control/web/tmpl/pdmenu.tmpl | 26 - tools/control/web/tmpl/vd-fv.tmpl | 60 -- tools/control/web/tmpl/vd-pa.tmpl | 97 ---- tools/control/web/tmpl/vd-par.tmpl | 61 -- tools/control/web/tmpl/vd-pv.tmpl | 54 -- tools/control/web/tmpl/vd-vbdc.tmpl | 94 ---- tools/control/web/tmpl/vd-vbdcr.tmpl | 92 --- tools/control/web/tmpl/vd-vbdv.tmpl | 57 -- tools/control/web/tmpl/vd-vdc.tmpl | 67 --- tools/control/web/tmpl/vd-vdcr.tmpl | 91 --- tools/control/web/tmpl/vd-vdd.tmpl | 60 -- tools/control/web/tmpl/vd-vddr.tmpl | 34 -- tools/control/web/tmpl/vd-vdr.tmpl | 85 --- tools/control/web/tmpl/vd-vdrr.tmpl | 77 --- tools/control/web/tmpl/vd-vdv.tmpl | 45 -- tools/control/web/tmpl/vd.tmpl | 24 - tools/control/web/tmpl/vdmenu.tmpl | 57 -- tools/control/web/tmpl/xenofoot.def | 28 - tools/control/web/tmpl/xenohead.def | 84 --- tools/control/web/tmpl/xenostyle.css | 91 --- tools/control/xenctl | 13 - tools/internal/Makefile | 49 -- tools/internal/dom0_defs.h | 143 ----- tools/internal/mem_defs.h | 35 -- tools/internal/rpm.spec | 37 -- tools/internal/xi_build.c | 527 ------------------ tools/internal/xi_create.c | 46 -- tools/internal/xi_destroy.c | 49 -- tools/internal/xi_helper | 24 - tools/internal/xi_list.c | 71 --- tools/internal/xi_phys_grant.c | 67 --- tools/internal/xi_read_console_ring.c | 60 -- tools/internal/xi_restore_linux.c | 498 ----------------- tools/internal/xi_save_linux.c | 410 -------------- tools/internal/xi_sched_domain.c | 31 -- tools/internal/xi_sched_global.c | 26 - tools/internal/xi_start.c | 43 -- tools/internal/xi_stop.c | 43 -- tools/internal/xi_usage.c | 63 --- tools/internal/xi_vbd_add.c | 44 -- tools/internal/xi_vbd_create.c | 43 -- tools/internal/xi_vbd_info.c | 63 --- tools/internal/xi_vbd_list.c | 65 --- tools/internal/xi_vif_params.c | 85 --- tools/internal/xi_vifinit | 33 -- tools/misc/Makefile | 10 +- tools/misc/xen_cpuperf.c | 76 +-- tools/misc/xi_createlinuxdom.py | 101 ++++ tools/misc/xi_destroydom.py | 18 + tools/misc/xi_listdoms.py | 10 + tools/misc/xi_stopdom.py | 15 + tools/xc/py/Xc.c | 66 ++- .../arch/xeno/drivers/block/Makefile | 2 +- .../arch/xeno/drivers/block/info.c | 111 ---- 157 files changed, 286 insertions(+), 11770 deletions(-) delete mode 100644 tools/control/Makefile delete mode 100644 tools/control/build-cmdline.xml delete mode 100644 tools/control/build-web.xml delete mode 100644 tools/control/build.properties delete mode 100644 tools/control/doc/INSTALL-cmdline delete mode 100644 tools/control/doc/INSTALL-web delete mode 100644 tools/control/doc/USAGE-cmdline delete mode 100644 tools/control/examples/etc.exports-example delete mode 100644 tools/control/examples/grub.conf-example delete mode 100644 tools/control/examples/xen-mynewdom delete mode 100644 tools/control/examples/xenctl.xml delete mode 100644 tools/control/examples/xenctl.xml-dom0nfs delete mode 100644 tools/control/examples/xenctl.xml-linklocal delete mode 100644 tools/control/examples/xenctl.xml-publicip delete mode 100644 tools/control/src/org/xenoserver/cmdline/CommandParser.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/Main.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseDomainList.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseFailedException.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseGroup.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseHelp.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseScript.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVdFree.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java delete mode 100644 tools/control/src/org/xenoserver/cmdline/ParseVdShow.java delete mode 100644 tools/control/src/org/xenoserver/control/Command.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandDomainDestroy.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandDomainList.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandDomainNew.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandDomainStart.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandDomainStop.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandFailedException.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandPartitionAdd.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandPhysicalList.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandVbdCreate.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandVbdList.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandVdCreate.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandVdDelete.java delete mode 100644 tools/control/src/org/xenoserver/control/CommandVdRefresh.java delete mode 100644 tools/control/src/org/xenoserver/control/Defaults.java delete mode 100644 tools/control/src/org/xenoserver/control/Domain.java delete mode 100644 tools/control/src/org/xenoserver/control/Extent.java delete mode 100644 tools/control/src/org/xenoserver/control/InetAddressPattern.java delete mode 100644 tools/control/src/org/xenoserver/control/Library.java delete mode 100644 tools/control/src/org/xenoserver/control/Mode.java delete mode 100644 tools/control/src/org/xenoserver/control/Partition.java delete mode 100644 tools/control/src/org/xenoserver/control/PartitionManager.java delete mode 100644 tools/control/src/org/xenoserver/control/Settings.java delete mode 100644 tools/control/src/org/xenoserver/control/StringPattern.java delete mode 100644 tools/control/src/org/xenoserver/control/VirtualBlockDevice.java delete mode 100644 tools/control/src/org/xenoserver/control/VirtualDisk.java delete mode 100644 tools/control/src/org/xenoserver/control/VirtualDiskManager.java delete mode 100644 tools/control/src/org/xenoserver/control/XML.java delete mode 100644 tools/control/src/org/xenoserver/control/XMLHelper.java delete mode 100644 tools/control/src/org/xenoserver/web/RootBean.java delete mode 100644 tools/control/src/org/xenoserver/web/SystemConfigurationBean.java delete mode 100644 tools/control/web/WEB-INF/web.xml delete mode 100644 tools/control/web/img/cambridge.gif delete mode 100644 tools/control/web/img/help.gif delete mode 100644 tools/control/web/img/home.gif delete mode 100644 tools/control/web/img/pixel.gif delete mode 100644 tools/control/web/img/search.gif delete mode 100644 tools/control/web/img/xeno.gif delete mode 100644 tools/control/web/tmpl/about.tmpl delete mode 100644 tools/control/web/tmpl/dom-del.tmpl delete mode 100644 tools/control/web/tmpl/dom-delr.tmpl delete mode 100644 tools/control/web/tmpl/dom-lis.tmpl delete mode 100644 tools/control/web/tmpl/dom-new.tmpl delete mode 100644 tools/control/web/tmpl/dom-newr.tmpl delete mode 100644 tools/control/web/tmpl/dom-sta.tmpl delete mode 100644 tools/control/web/tmpl/dom-star.tmpl delete mode 100644 tools/control/web/tmpl/dom-stp.tmpl delete mode 100644 tools/control/web/tmpl/dom-stpr.tmpl delete mode 100644 tools/control/web/tmpl/dom.tmpl delete mode 100644 tools/control/web/tmpl/dommenu.tmpl delete mode 100644 tools/control/web/tmpl/help.tmpl delete mode 100644 tools/control/web/tmpl/index.tmpl delete mode 100755 tools/control/web/tmpl/install.pl delete mode 100644 tools/control/web/tmpl/makefile delete mode 100644 tools/control/web/tmpl/pd-g.tmpl delete mode 100644 tools/control/web/tmpl/pd-gr.tmpl delete mode 100644 tools/control/web/tmpl/pd-l.tmpl delete mode 100644 tools/control/web/tmpl/pd-r.tmpl delete mode 100644 tools/control/web/tmpl/pd-rr.tmpl delete mode 100644 tools/control/web/tmpl/pd.tmpl delete mode 100644 tools/control/web/tmpl/pdmenu.tmpl delete mode 100644 tools/control/web/tmpl/vd-fv.tmpl delete mode 100644 tools/control/web/tmpl/vd-pa.tmpl delete mode 100644 tools/control/web/tmpl/vd-par.tmpl delete mode 100644 tools/control/web/tmpl/vd-pv.tmpl delete mode 100644 tools/control/web/tmpl/vd-vbdc.tmpl delete mode 100644 tools/control/web/tmpl/vd-vbdcr.tmpl delete mode 100644 tools/control/web/tmpl/vd-vbdv.tmpl delete mode 100644 tools/control/web/tmpl/vd-vdc.tmpl delete mode 100644 tools/control/web/tmpl/vd-vdcr.tmpl delete mode 100644 tools/control/web/tmpl/vd-vdd.tmpl delete mode 100644 tools/control/web/tmpl/vd-vddr.tmpl delete mode 100644 tools/control/web/tmpl/vd-vdr.tmpl delete mode 100644 tools/control/web/tmpl/vd-vdrr.tmpl delete mode 100644 tools/control/web/tmpl/vd-vdv.tmpl delete mode 100644 tools/control/web/tmpl/vd.tmpl delete mode 100644 tools/control/web/tmpl/vdmenu.tmpl delete mode 100644 tools/control/web/tmpl/xenofoot.def delete mode 100644 tools/control/web/tmpl/xenohead.def delete mode 100644 tools/control/web/tmpl/xenostyle.css delete mode 100755 tools/control/xenctl delete mode 100644 tools/internal/Makefile delete mode 100644 tools/internal/dom0_defs.h delete mode 100644 tools/internal/mem_defs.h delete mode 100644 tools/internal/rpm.spec delete mode 100644 tools/internal/xi_build.c delete mode 100644 tools/internal/xi_create.c delete mode 100644 tools/internal/xi_destroy.c delete mode 100755 tools/internal/xi_helper delete mode 100644 tools/internal/xi_list.c delete mode 100644 tools/internal/xi_phys_grant.c delete mode 100644 tools/internal/xi_read_console_ring.c delete mode 100644 tools/internal/xi_restore_linux.c delete mode 100644 tools/internal/xi_save_linux.c delete mode 100644 tools/internal/xi_sched_domain.c delete mode 100644 tools/internal/xi_sched_global.c delete mode 100644 tools/internal/xi_start.c delete mode 100644 tools/internal/xi_stop.c delete mode 100644 tools/internal/xi_usage.c delete mode 100644 tools/internal/xi_vbd_add.c delete mode 100644 tools/internal/xi_vbd_create.c delete mode 100644 tools/internal/xi_vbd_info.c delete mode 100644 tools/internal/xi_vbd_list.c delete mode 100644 tools/internal/xi_vif_params.c delete mode 100755 tools/internal/xi_vifinit create mode 100755 tools/misc/xi_createlinuxdom.py create mode 100644 tools/misc/xi_destroydom.py create mode 100644 tools/misc/xi_listdoms.py create mode 100644 tools/misc/xi_stopdom.py delete mode 100644 xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c diff --git a/.rootkeys b/.rootkeys index dd191267c8..a30c685011 100644 --- a/.rootkeys +++ b/.rootkeys @@ -39,151 +39,6 @@ 3e6377b24eQqYMsDi9XrFkIgTzZ47A tools/balloon/Makefile 3e6377d6eiFjF1hHIS6JEIOFk62xSA tools/balloon/README 3e6377dbGcgnisKw16DPCaND7oGO3Q tools/balloon/balloon.c -3eb781edFwm_pW9FwnQACIe68viLOw tools/control/Makefile -3eb781fceEYkUi1XHKf2V0KX7si2JA tools/control/build-cmdline.xml -3ec41f7cWCxQ8pdH8ZWqhhv-38qQ1w tools/control/build-web.xml -3ec41f7ca6IBXDSe0HVcMPp3PPloOQ tools/control/build.properties -3f0d61da3O5gkcntbIOdUmN2-RcZbQ tools/control/doc/INSTALL-cmdline -3eca6a96a31IwaKtkEa4jmzwTWlm8Q tools/control/doc/INSTALL-web -3f0d61daCTHGCpQK0Brz3PAp80d_2Q tools/control/doc/USAGE-cmdline -3f77f25c4zdCalc5d0YnMGEnc9By-Q tools/control/examples/etc.exports-example -3f776bd12y6bW-wtcs6rD2qhdpT_Rw tools/control/examples/grub.conf-example -3f776bd1RBu7Gnce6Bq9328QFUZBsw tools/control/examples/xen-mynewdom -3eb781fcabCKRogwxJA3-jJKstw9Vg tools/control/examples/xenctl.xml -3f776bd1bfwM-pP6b2qd0vih1KeV8w tools/control/examples/xenctl.xml-dom0nfs -3f776bd1-A4vvCCsz-KOgZyAj4ux2g tools/control/examples/xenctl.xml-linklocal -3f776bd2y1sfPGpfiaj4A-sRdUON7A tools/control/examples/xenctl.xml-publicip -3f042c35FzVap5QW0UBPnZ2ZM0l3QA tools/control/src/org/xenoserver/cmdline/CommandParser.java -3eb781fdNQvEJW3tNvovjqoN7GlePA tools/control/src/org/xenoserver/cmdline/Main.java -3f042c35-TPgpCQViIaJzLts2-CnBw tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java -3f042c35h9GAWRu7wimPjBpCi09nUA tools/control/src/org/xenoserver/cmdline/ParseDomainList.java -3f042c359mRNaxBYXFwVsmv5-J_DJA tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java -3f042c35bMvqLB4Yc-0Dxs4WlYHHpw tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java -3f042c35Lc-JegNavF6Bj6coM486Ig tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java -3f042c35UhRkvblwKSx0KW2QHUn3Fw tools/control/src/org/xenoserver/cmdline/ParseFailedException.java -3f0445524oTSyogDGmCAyKMM665Rxg tools/control/src/org/xenoserver/cmdline/ParseGroup.java -3f042c35Inw0LzkOzXo9ncbEHZzUHA tools/control/src/org/xenoserver/cmdline/ParseHelp.java -3f098761jTSCT4f7lCWFePC3TJN_nw tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java -3f05631djnPcaqmzMFSa8RLmGCZ-0Q tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java -3f05631dswxJX_TpcuG6tBstyHSetg tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java -3f05631dMY7PMkwSY7zBFelGJ8goVg tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java -3f05631dYDFXv6mwNFAgz3ta9kShJA tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java -3f5f3d95BlaPZ2JHfpjHuHscx2SJow tools/control/src/org/xenoserver/cmdline/ParseScript.java -3f0bdfabfXM4tMbvmV06di5U-5FfqA tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java -3f0bec93F_VDIcn9oeXwJYwydX20kg tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java -3f098761TRsbDk9woUM846Q6_F7EmA tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java -3f099009pmH9MFkRYwP2V1DfsqEwdg tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java -3f098761zh9WTV6LpRqcet3gqlXdtg tools/control/src/org/xenoserver/cmdline/ParseVdFree.java -3f099009lDK_5xXO4gPyPpCTUhgnCA tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java -3f098761vY4hzt_QKskmvMcibN0zYQ tools/control/src/org/xenoserver/cmdline/ParseVdShow.java -3f042c35V-Bf3dlIe1r5mZs8ZTPSvA tools/control/src/org/xenoserver/control/Command.java -3f042c35U_4O2eovLKUgo2avPPHKUw tools/control/src/org/xenoserver/control/CommandDomainDestroy.java -3f042c3570VRwuzl94tEozOIVBycNg tools/control/src/org/xenoserver/control/CommandDomainList.java -3f042c35xVm-ucJAVdvC3acD6ZEe2Q tools/control/src/org/xenoserver/control/CommandDomainNew.java -3f042c36GqoXJJj_BvWGwBeKwEzgvg tools/control/src/org/xenoserver/control/CommandDomainStart.java -3f042c36bmZJD0xrxURD075avUlIUg tools/control/src/org/xenoserver/control/CommandDomainStop.java -3f042c35hdwL__Airzyz4HutOgGRqQ tools/control/src/org/xenoserver/control/CommandFailedException.java -3f0987611uZwg-o64yi0p_2aXCYEug tools/control/src/org/xenoserver/control/CommandPartitionAdd.java -3f05631ev3UK5FRi5vgR08zDp3OZYw tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java -3f05631e_G6wzHhEnpihX0pIkEsbMw tools/control/src/org/xenoserver/control/CommandPhysicalList.java -3f05631eGWxq7bojQbMa-tGxsENIhw tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java -3f0bdfab88VYiD26FXCDmmAAGJ8zWA tools/control/src/org/xenoserver/control/CommandVbdCreate.java -3f0bdfabI14M5_odjCIwQbXCdauReA tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java -3f0d4a70B132OMLyoUBFJAfNCATCww tools/control/src/org/xenoserver/control/CommandVbdList.java -3f098761c5-idlmf9vWEMOlDw0VCHg tools/control/src/org/xenoserver/control/CommandVdCreate.java -3f0990096KcyQw77qJmjTu941smS8A tools/control/src/org/xenoserver/control/CommandVdDelete.java -3f0990093VJUL7QjxGigR5GPXf_Fkw tools/control/src/org/xenoserver/control/CommandVdRefresh.java -3eb781fdBRXfSlWzK6GXlIQIlHFoaQ tools/control/src/org/xenoserver/control/Defaults.java -3ec41f7cQ7Ug739JBDrsVH-7KJ5MvQ tools/control/src/org/xenoserver/control/Domain.java -3ec41f7cAzdBu0lkuTTQx92rqSM9Qw tools/control/src/org/xenoserver/control/Extent.java -3eb781fdDeZEopemXIVg_ARCGKSmBw tools/control/src/org/xenoserver/control/InetAddressPattern.java -3ec41f7cqN_uVR_7TqjgypDfFdGyrg tools/control/src/org/xenoserver/control/Library.java -3ec41f7dsb1R8BvBNzjYufMrx6ONdA tools/control/src/org/xenoserver/control/Mode.java -3ec41f7dbqJLTy1msByMzQhy3jHHyQ tools/control/src/org/xenoserver/control/Partition.java -3ec41f7djIGkw6M9meq8-YZ1WDATcw tools/control/src/org/xenoserver/control/PartitionManager.java -3eb781fdmMkFbyb2SAGR0vsuFtl9Lw tools/control/src/org/xenoserver/control/Settings.java -3eb781fdpgi83RpUvQWVccWjsDJK7w tools/control/src/org/xenoserver/control/StringPattern.java -3ec41f7dNJZ1YkLD8X5CsqqYmP601g tools/control/src/org/xenoserver/control/VirtualBlockDevice.java -3ec41f7dVFBlviwXPQ06BlU3UybziA tools/control/src/org/xenoserver/control/VirtualDisk.java -3ec41f7dKX9YpwrfH7BZ7BogyWqqLA tools/control/src/org/xenoserver/control/VirtualDiskManager.java -3ec41f7dUPpYTwYL5QVpRBv6PLKPrg tools/control/src/org/xenoserver/control/XML.java -3ec41f7d7Try-2zmfnpaALwJjY0GCA tools/control/src/org/xenoserver/control/XMLHelper.java -3ec41f7dOVZgjP4sQS6vjuBnExdlMQ tools/control/src/org/xenoserver/web/RootBean.java -3ec41f7dvPdszb0frNEkMnEdJUBVjA tools/control/src/org/xenoserver/web/SystemConfigurationBean.java -3ec41f7dO6IuKGGLG4VRUhMDmkTn5g tools/control/web/WEB-INF/web.xml -3ec41f7dRAPXBA0jQUd1k6MB3xVidg tools/control/web/img/cambridge.gif -3ec41f7dvxVe1Vb3kVOLZcN5Jra2tQ tools/control/web/img/help.gif -3ec41f7dJYExm-ityN2SgVVaeR_BYA tools/control/web/img/home.gif -3ec41f7d4IYjCuVYWjgq-OCue4O0Vw tools/control/web/img/pixel.gif -3ec41f7dW6Rxbc2h5vulWqEkj0rMzA tools/control/web/img/search.gif -3ec41f7d-WawzXt-iMiQON6VVF0d6Q tools/control/web/img/xeno.gif -3ec41f7d6gAIVIeI6d36osnxPNIbEw tools/control/web/tmpl/about.tmpl -3ec41f7dU7BdfMqTjNuI2yFIE9YTxQ tools/control/web/tmpl/dom-del.tmpl -3ec41f7dnAVr1lPsPDV0cwNe-cDiSw tools/control/web/tmpl/dom-delr.tmpl -3ec41f7dKNiNO7usbqUVaXvZafVzSg tools/control/web/tmpl/dom-lis.tmpl -3ec41f7dJ4oF7TdF8c858DgzXAPJUA tools/control/web/tmpl/dom-new.tmpl -3ec41f7dPelejfeiuXzFeETZXtYY3g tools/control/web/tmpl/dom-newr.tmpl -3ec41f7deN7cXpkmKhmp9nGMWtQ9Yw tools/control/web/tmpl/dom-sta.tmpl -3ec41f7dFl7cFsLVTEu06abaLjrh7A tools/control/web/tmpl/dom-star.tmpl -3ec41f7dOyejg7nsGjHhwS9dRwuwJQ tools/control/web/tmpl/dom-stp.tmpl -3ec41f7d-jdCAs49yO8mmvGdbVnFcQ tools/control/web/tmpl/dom-stpr.tmpl -3ec41f7d2S1JM6utrcajiWWmPi85TA tools/control/web/tmpl/dom.tmpl -3ec41f7dPyCkHbXAufQ0Nxnvhq7XpQ tools/control/web/tmpl/dommenu.tmpl -3ec41f7dZRDqKe8wk__95ztDQmaAOA tools/control/web/tmpl/help.tmpl -3ec41f7eTqbaFqMGU7lJG09vlEt0TQ tools/control/web/tmpl/index.tmpl -3ec41f7ed6_QZ1mg0vuA9Xu1wu1plw tools/control/web/tmpl/install.pl -3ec41f7emmAnjM4gsW6JWkqsjfi4Rg tools/control/web/tmpl/makefile -3f0d3c5bP8omJUhjEmXpsRvOZH3igw tools/control/web/tmpl/pd-g.tmpl -3f0d3c5bpmNu22iZ8mb-9hzOZUWEZw tools/control/web/tmpl/pd-gr.tmpl -3f0d3c5b1oQA8A-Y4AK0akN9k2T1KQ tools/control/web/tmpl/pd-l.tmpl -3f0d3c5bkJgUEumHh-qAL3ZB1xApSw tools/control/web/tmpl/pd-r.tmpl -3f0d3c5bOEOuHzB1HdWY9GvlYj7H-w tools/control/web/tmpl/pd-rr.tmpl -3f0d3c5cb9-AClRfExuRwJi45LcYuA tools/control/web/tmpl/pd.tmpl -3f0d3c5cQqQ23OpQJx-sNE0-EclRlA tools/control/web/tmpl/pdmenu.tmpl -3ec41f7eoDHD2raa4x6dBINr4QLO3A tools/control/web/tmpl/vd-fv.tmpl -3ec41f7eawycxV05Ow3LfZtOlHZJPA tools/control/web/tmpl/vd-pa.tmpl -3ec41f7ef4mVT4vwOEL40MKIzS4EeA tools/control/web/tmpl/vd-par.tmpl -3ec41f7e1-bFRAfSveBhJNc-yQguXQ tools/control/web/tmpl/vd-pv.tmpl -3ec41f7e6v7MAKuV03qkOLX94vCGQg tools/control/web/tmpl/vd-vbdc.tmpl -3ec41f7eInaxQyoN0zPtGH6O1l0qaA tools/control/web/tmpl/vd-vbdcr.tmpl -3ec41f7eSe6rb0p4IxLU16czqIaTCA tools/control/web/tmpl/vd-vbdv.tmpl -3ec41f7eAYtNdK1Yy-RdGMCcSDNfBA tools/control/web/tmpl/vd-vdc.tmpl -3ec41f7eFxwTmuQ8wWMdvVQ5jtiKKA tools/control/web/tmpl/vd-vdcr.tmpl -3ec41f7e2osvqR4HUXCd9zUIIvUjaA tools/control/web/tmpl/vd-vdd.tmpl -3ec41f7e_TlFUNtMUUk1vivYx-4M2w tools/control/web/tmpl/vd-vddr.tmpl -3ec41f7eqey0GnU2CvlvO0OvX0Pmgg tools/control/web/tmpl/vd-vdr.tmpl -3ec41f7elad0gJQYmWPOikqUUKkMtA tools/control/web/tmpl/vd-vdrr.tmpl -3ec41f7eQ2vdTzXZAbxIWCosxZHJkg tools/control/web/tmpl/vd-vdv.tmpl -3ec41f7estxrL28BGG8obBnzt-SiAA tools/control/web/tmpl/vd.tmpl -3ec41f7e6SAwV8ebs9Be7zV2LV92oQ tools/control/web/tmpl/vdmenu.tmpl -3ec41f7ecn3uvsSrOVxKC8G8ACuulg tools/control/web/tmpl/xenofoot.def -3ec41f7ek1RffqN2yRUzSTkD5m1J6w tools/control/web/tmpl/xenohead.def -3ec41f7e1ZpfCsgQ2qRJBooBn_iRtA tools/control/web/tmpl/xenostyle.css -3eb781fc6vgq5yhkJRGDLY9gWWRY2A tools/control/xenctl -3eb781fdl4lXWYZzmqDDUAYhAThRqQ tools/internal/Makefile -3eb781fdc539MQQm47rYRCCR3N5i-Q tools/internal/dom0_defs.h -3eb781fdKiQbgozBsgs_zzJQ9ubehw tools/internal/mem_defs.h -3ec61e1bJCeJJu0SsptmDpA1xKvwvw tools/internal/rpm.spec -3eb781fdgbSkh2O6JQS-65Dz4n0ItQ tools/internal/xi_build.c -3eb781fdW1SAyiaC4mTsXq_9fRHh-A tools/internal/xi_create.c -3eb781fdcJ0fF7rWfzAOArW-x4-gwA tools/internal/xi_destroy.c -3ec43c5dmQxGDvgJJXbV1yLxT30Y1A tools/internal/xi_helper -3f108ad5wQm0ZaQ4GXFoUhH1W1aW9w tools/internal/xi_list.c -3f0458aaXhD8BQAggO81gv30RQ-ifA tools/internal/xi_phys_grant.c -3fb14ab76b0aJu66S18CVjlemLwk4Q tools/internal/xi_read_console_ring.c -3fa9861aBdNV1yCjfY4cLPr4Mtrpuw tools/internal/xi_restore_linux.c -3fa98615LWZfagwDBp7XfuC-u9wi3w tools/internal/xi_save_linux.c -3f108adb2b5OkKL6-faG3lMiOYDf_w tools/internal/xi_sched_domain.c -3f108ade1v8weyh1sKx890VTd240Hw tools/internal/xi_sched_global.c -3eb781fd8oRfPgH7qTh7xvgmwD6NgA tools/internal/xi_start.c -3eb781fd0Eo9K1jEFCSAVzO51i_ngg tools/internal/xi_stop.c -3f108ae2to5nHRRXfvUK7oxgjcW_yA tools/internal/xi_usage.c -3fb01fd5CGkDlZddcIlPxLwrquLqKA tools/internal/xi_vbd_add.c -3fb01fd5MoGCWdylPicf4UinUjYfDg tools/internal/xi_vbd_create.c -3fb01fd54I4P44vZDb1CtDt1BytDtA tools/internal/xi_vbd_info.c -3fb01fd5B-UeibZkmSCOUZckNyNFYA tools/internal/xi_vbd_list.c -3f86be322bd0h9jG3krZFOUgCDoxZg tools/internal/xi_vif_params.c -3eb781fd7211MZsLxJSiuy7W4KnJXg tools/internal/xi_vifinit 3f776bd2Xd-dUcPKlPN2vG89VGtfvQ tools/misc/Makefile 3f6dc136ZKOjd8PIqLbFBl_v-rnkGg tools/misc/miniterm/Makefile 3f6dc140C8tAeBfroAF24VrmCS4v_w tools/misc/miniterm/README @@ -198,6 +53,10 @@ 3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README 3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c 3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c +3fbe2f12OPAkzIUtumU3wRAihnhocQ tools/misc/xi_createlinuxdom.py +3fbe2f12dZbmXLlgQdMgkmnSUj23AQ tools/misc/xi_destroydom.py +3fbe2f12ltvweb13kBSsxqzZDAq4sg tools/misc/xi_listdoms.py +3fbe2f12Bnt8mwmr1ZCP6HWGS6yvYw tools/misc/xi_stopdom.py 3fbca441SjQr8vJwTQIgH1laysaWog tools/xc/Makefile 3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/xc/lib/Makefile 3fbba6dbEVkVMX0JuDFzap9jeaucGA tools/xc/lib/libxc_bvtsched.c @@ -598,7 +457,6 @@ 3e6377f5xwPfYZkPHPrDbEq1PRN7uQ xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/Makefile 3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c 3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile -3f689056Vxx_8K8DQTRysOxx_ikmLg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c 3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c 3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.h 3e676eb5RXnHzSHgA1BvM0B1aIm4qg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_vbd.c diff --git a/docs/Xeno-HOWTO b/docs/Xeno-HOWTO index 49a8ee1ed5..bfa3610927 100644 --- a/docs/Xeno-HOWTO +++ b/docs/Xeno-HOWTO @@ -99,27 +99,21 @@ This is the gzip version of XenoLinux kernel image. Build the Domain Control Tools ============================== -Under '/xeno-1.1.bk/tools', there are four sub-directories: -'balloon', 'control', 'internal' and 'misc', each containing +Under '/xeno-1.1.bk/tools', there are three sub-directories: +'balloon', 'xc' and 'misc', each containing a group of tools. You can enter any of the four sub-directories and type 'make' to compile the corresponding group of tools. Or you can type 'make' under '/xeno-1.1.bk/tools' to compile all the tools. -Particularly, in order to compile tools under 'control', you -must have Apache Ant installed. Latest binary can be found at -'http://ant.apache.org/bindownload.cgi'. +In order to compile the control-interface library in 'xc' you must +have zlib and devlopment headers installed. Also you will need at +least Python v2.2. -Besides, you must have Java J2SDK 1.4 installed. There seemed -to be compilation errors with J2SDK 1.3, but fine with J2SDK 1.4 - -To summarize: - -# cd /xeno-1.1.bk/tools -# make -# make install -# cd /install/bin -# cp * /usr/local/bin +'make install' in the tools directory will place executables and +libraries in an install directory immediately outside you local +repository. NOTE: the installation of the Python modules may need root +privileges if you are not using a personal installation of Python. Installation @@ -181,55 +175,6 @@ The following is a list of command line arguments to pass to Xen: dom0_mem=xxx Set the maximum amount of memory for domain0. -Xenctl Configuration -============================== - -# cd /xeno-1.1.bk/tools/control/examples -# cp xenctl.xml xen-mynewdom /etc - -Then, you need to modify /etc/xen-mynewdom: - -# cat /etc/xen-mynewdom -domain new -physical grant -pcdrom_link -domain start - -You should substitue 'cdrom_link' with the -root partition, e.g. '/dev/hda3', '/dev/sda1'. -Therefore, the second looks like: -'physical grant -p/dev/hda3' - -Then, you need to modify /etc/xenctl.xml: - -# cat /etc/xenctl.xml - - -XenoLinux -98304 -/boot/xenolinux.gz -1 -/boot/initrd.gz -/dev/ram0 -rw -init=/linuxrc 4 DOMID=+ -169.254.1.0+ -169.254.1.0 -255.255.0.0 -169.254.1.0 -1000 -/usr/local/bin/ - - -The meaning of every line is very straightforward -and should be modified according to your configuration. - -Normally you don't need . And you probably want -root_args set to "ro", otherwise fsck will complain. Assuming you've -installed a standard linux installation, you probably don't want to -explicit set the init program, or the run level, -e.g. DOMID=+ - - Boot into Domain 0 ============================== @@ -259,31 +204,43 @@ UDP packets to the local virtual network. Those packets are received by xen_read_console running in Domain 0 and output are printed out to the standard output. -# xenctl script -f/etc/xen-mynewdom - -This will create and start a new domain based on /etc/xen-mynewdom and -/etc/xenctl.xml +Now edit the installed xi_createlinuxdom.py script to your taste. This +should then be executed as root to create a new domain. You should be able to see XenoLinux boot message on standard output -with each line prepended [domain_id]. +with each line prepended with [domain_id]. List and Stop Domains ============================== You can see a list of existing domains with: - -# xi_list -or -# xenctl domain list +# xi_listdoms.py In order to stop a domain, you use: +# xi_stopdom.py + +To destroy a domain use ('force' causes an immediate destruction +without waiting for the guest OS to shut down cleanly): +# xi_destroydom.py [force] + + +Other Control Tasks using Python +================================ + +A Python module 'Xc' is installed as part of the tools-install +process. This can be imported, and an 'xc object' instantiated, to +provide access to privileged command operations: + +# import Xc +# xc = Xc.new() +# dir(xc) +# help(xc.domain_create) + +In this way you can see that the class 'xc' contains useful +documentation for you to consult. -# xi_stop domain_id -or -# xenctl domain stop -ndomain_id +A further module of useful routines (XenoUtil) is also installed: -followed by -# xi_destroy domain_id -or -# xenctl domain destroy -ndomain_id \ No newline at end of file +# import XenoUtil +# help(XenoUtil) \ No newline at end of file diff --git a/tools/Makefile b/tools/Makefile index 42c579823b..18994da98d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -19,22 +19,16 @@ all: $(MAKE) -C balloon - $(MAKE) -C control - $(MAKE) -C internal $(MAKE) -C xc $(MAKE) -C misc install: all $(MAKE) -C balloon install - $(MAKE) -C control install - $(MAKE) -C internal install $(MAKE) -C xc install $(MAKE) -C misc install clean: $(MAKE) -C balloon clean - $(MAKE) -C control clean - $(MAKE) -C internal clean $(MAKE) -C xc clean $(MAKE) -C misc clean diff --git a/tools/control/Makefile b/tools/control/Makefile deleted file mode 100644 index ce594d833b..0000000000 --- a/tools/control/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -#default: cmdline web -default: cmdline - -#install: install-cmdline install-web -install: install-cmdline examples - -clean: clean-cmdline clean-web - -examples: FORCE - mkdir -p ../../../install/etc - chmod +w ../../../install/etc/* || true - cp examples/xen* examples/*example ../../../install/etc/ - -cmdline: FORCE - ant -buildfile build-cmdline.xml dist - -install-cmdline: cmdline - mkdir -p ../../../install/bin - cp -a xenctl-cmdline.jar xenctl ../../../install/bin - chmod 755 ../../../install/bin/xenctl - -clean-cmdline: - ant -buildfile build-cmdline.xml clean - rm -f xenctl-cmdline.jar - - - -web: FORCE - ant -buildfile build-web.xml dist - -install-web: xenctl - ant -buildfile build-web.xml remove || true - ant -buildfile build-web.xml install - -clean-web: - ant -buildfile build-web.xml clean - rm -f xenctl-web.jar - -FORCE: diff --git a/tools/control/build-cmdline.xml b/tools/control/build-cmdline.xml deleted file mode 100644 index 56c2af143a..0000000000 --- a/tools/control/build-cmdline.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/control/build-web.xml b/tools/control/build-web.xml deleted file mode 100644 index 81227ea025..0000000000 --- a/tools/control/build-web.xml +++ /dev/null @@ -1,477 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all clean, them compile - dist create war file - install install application in servlet container - list list applications installed in servelet container - reload reload application in servlet container - remove dynamically remove web application - - - diff --git a/tools/control/build.properties b/tools/control/build.properties deleted file mode 100644 index 22dc78763b..0000000000 --- a/tools/control/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -catalina.home=/usr/groups/xeno/build_tools/jakarta-tomcat-4.1.24 -# change to your xenoserver -manager.url=http:///manager -manager.username=hobbes -manager.password=tiger -compile.optimize=false - diff --git a/tools/control/doc/INSTALL-cmdline b/tools/control/doc/INSTALL-cmdline deleted file mode 100644 index 4290631e29..0000000000 --- a/tools/control/doc/INSTALL-cmdline +++ /dev/null @@ -1,14 +0,0 @@ -To install command line interface: - -cd xeno.bk/tools/control -make cmdline -cp xenctl xenctl-cmdline.jar /usr/local/bin -cp xenctl.xml /etc -mkdir /var/lib/xen - -First invocation of command line interface will give a warning about not being -able to load the disk state from /var/lib/xen/vdstate.xml. This is ok, it'll -be created the first time you change any state in the virtual disk manager. - -If you already have /etc/domctl.xml you can rename it to xenctl.xml to keep -your existing defaults. diff --git a/tools/control/doc/INSTALL-web b/tools/control/doc/INSTALL-web deleted file mode 100644 index af844c0222..0000000000 --- a/tools/control/doc/INSTALL-web +++ /dev/null @@ -1,50 +0,0 @@ - -some notes on configuring xenctl web interface... - -to build: - - export PATH=/usr/groups/xeno/build_tools/bin:${PATH} - # this next step has already been done. - # cp $CATALINA_HOME/server/lib/catalina-ant.jar $ANT_HOME/lib - cd xeno.bk/tools/control - make web - # You only need to make/install internal if you haven't already - # it's also needed by the cmdline tool - cd xeno.bk/tools/internal - make - -to setup: - - ## expand the jakarta (aka catalina) tree somewhere accessible by dom0 - export ROOTDIR=/anfs/scratch/ - cd $ROOTDIR - tar zxf /usr/groups/xeno/archive/tomcat-4.1.24.tar.gz - export CATALINA_HOME=$ROOTDIR/jakarta-tomcat-4.1.24 - export JAVA_HOME=/usr/groups/xeno/build_tools/java-1.4.1 - - ## edit $CATALINA_HOME/conf/server.xml, change port 8080 to port 80 - cp $CATALINA_HOME/conf/server.xml $CATALINA_HOME/conf/server.orig - sed 's/8080/80/g' $CATALINA_HOME/conf/server.orig > $CATALINA_HOME/conf/server.xml - - ## install the xenctl web archive - cp xeno.bk/tools/control/dist/xenctl-0.1-dev.war $CATALINA_HOME/webapps/xenctl.war - # Only if you have not already copied this file for the command line tool - cp xeno.bk/tools/control/xenctl.xml /etc - # If it doesn't exist: - mkdir /var/lib/xen - - ## either edit xi_tools_dir in xenctl.xml or copy the binaries - ## unless already installed for the command line tool - # find xeno.bk/tools/internal -perm +111 -type f -exec cp {} /usr/local/bin \; - -to run: - $CATALINA_HOME/bin/startup.sh - # point your browser at hostname-0.xeno.cl.cam.ac.uk:80/xenctl - - -for development: - ## edit xeno.bk/tools/control/build.properties - # change manger.url to your xenoserver: mousetrap-0.xeno.cl.cam.ac.uk - ## to "make install-web" in xeno.bk/tools/control instead of copying the war file - cp $CATALINA_HOME/conf/tomcat-users.xml $CATALINA_HOME/conf/tomcat-users.orig - sed -e 's//\ \ \ /' $CATALINA_HOME/conf/tomcat-users.orig > $CATALINA_HOME/conf/tomcat-users.xml diff --git a/tools/control/doc/USAGE-cmdline b/tools/control/doc/USAGE-cmdline deleted file mode 100644 index 440e31e1d4..0000000000 --- a/tools/control/doc/USAGE-cmdline +++ /dev/null @@ -1,97 +0,0 @@ -IMPORTANT! DATA LOSS POTENTIAL! -------------------------------- - -It is important that no changes be made to the virtual disk manager through -the command line while the web interface is running! - -If you use the web interface at all, it is NOT safe to call: -xenctl partitions add -xenctl vd create -xenctl vd delete -xenctl vd refresh - -Your changes will likely be lost, or the virtual disks left in an -inconsistent state, or data on them corrupted or erased. - -Other xenctl functions do not modify VDM state and are therefore safe, -e.g. it's okay to do domain control from the command line if the web -interface is running. - -General -------- - -Invoking xenctl with no arguments, or with 'help' gives general usage -xenctl help command, or xenctl command -?, gives specific command help - -Domain control --------------- - -xenctl's command line interface is based on domctl. Defaults for domain -creation are found in /etc/xenctl.xml which has the same format as the -old domctl.xml - -Creating a domain: xenctl domain new -All parameters may be omitted to get defaults from xenctl.xml, see help -for ful details of available parameters. - -Starting a domain: xenctl domain start -n -Stopping a domain: xenctl domain stop -n -Destroying a domain: xenctl domain destroy -n (add -f to force - destruction of a running domain) - -Listing all domains: xenctl domain list - -Physical disk access management -------------------------------- - -Grant read-only access to a disk or partition: - xenctl physical grant -n -p (e.g. sda10, sdc..etc) -Grant read-write access to a disk or partition: - xenctl physical grant -w -n -p - (if you grant read-write to a domain which already has read for the same - partition, it will be upgraded quite happily, and vice versa) -Revoke access to a disk or partition: - xenctl physical revoke -n -p -List access a domain has: - xenctl physical list -n - will list all the physical disks/partitions which the given domain may access - and the rights assigned. - -Virtual disk management ------------------------ - -Add a disk partition as a XenoPartition (raw space to create VDs on): - xenctl partitions add -p -c - adds the partition, splitting it up into chunks of the size given - Sizes can all be specified as k, m, g. -Lists partitions: - xenctl partitions list - XenoPartitions are shown in [ ] - -Create a virtual disk: - xenctl vd create -n -s [-e] - Name is for identification only and need not be unique. Expiry may be none. - Size can be in k, m, g - You will be given a 10-digit key for the disk which is its unique identifier. -Delete a virtual disk: - xenctl vd delete -k - Virtual disks with VBDs mapped to them may not be deleted. -Refresh the expiry on a disk: - xenctl vd refresh -k [-e] - Sets a new expiry, may be none. -List virtual disks: - xenctl vd show - -List space free: - xenctl vd free - Shows how much space has been added with partitions add, but not allocated - to a virtual disk. - -Create a virtual block device: - xenctl vbd create -n -k -v [-w] - Maps the disk with the given key into the domain. -w allows read-write. - vbd number 0 = /dev/xvda, number 1 = /dev/xvdb, and so on. -Lists virtual block devices: - xenctl vbd show - -Virtual block devices are automatically deleted when their domain is destroyed. diff --git a/tools/control/examples/etc.exports-example b/tools/control/examples/etc.exports-example deleted file mode 100644 index 3a56773292..0000000000 --- a/tools/control/examples/etc.exports-example +++ /dev/null @@ -1,20 +0,0 @@ -/local/roots/root1 169.254.1.1(rw,no_root_squash) -/local/roots/root2 169.254.1.2(rw,no_root_squash) -/local/roots/root3 169.254.1.3(rw,no_root_squash) -/local/roots/root4 169.254.1.4(rw,no_root_squash) -/local/roots/root5 169.254.1.5(rw,no_root_squash) -/local/roots/root6 169.254.1.6(rw,no_root_squash) -/local/roots/root7 169.254.1.7(rw,no_root_squash) -/local/roots/root8 169.254.1.8(rw,no_root_squash) - -#/usr 169.254.1/24(ro,no_root_squash) - -/local/usrs/usr1 169.254.1.1(rw,no_root_squash) -/local/usrs/usr2 169.254.1.2(rw,no_root_squash) -/local/usrs/usr3 169.254.1.3(rw,no_root_squash) -/local/usrs/usr4 169.254.1.4(rw,no_root_squash) -/local/usrs/usr5 169.254.1.5(rw,no_root_squash) -/local/usrs/usr6 169.254.1.6(rw,no_root_squash) -/local/usrs/usr7 169.254.1.7(rw,no_root_squash) -/local/usrs/usr8 169.254.1.8(rw,no_root_squash) - diff --git a/tools/control/examples/grub.conf-example b/tools/control/examples/grub.conf-example deleted file mode 100644 index 0f9cd7a613..0000000000 --- a/tools/control/examples/grub.conf-example +++ /dev/null @@ -1,48 +0,0 @@ -# grub.conf -# -timeout=10 - -# We can control GRUB via COM1. -# Disable by default as it hangs on systems without a serial port and -# doesn't work with slpashimage enabled anyhow. -# -# serial --unit=0 --speed=115200 -# terminal --timeout=10 serial console - -# These examples are from the Xen Demo CD, so the root filesystem setup -# using an initrd to mount the read only /usr is all rather non standard. -# There are arguably more normal examples in the README.CD file. Read -# the standard Linux documenation to find out about kernel cmd line -# parameters. - -# The two lots of console= parameters cause the domain 0 Linux to use both -# the VGA scree consoles and the Xen output-only console - -# We also make use of the ability to pass arbitrary environment variables -# on the kernel command line, so set the DOMID variable. - -splashimage=/boot/grub/splash.xpm.gz - -default=0 - -title Xen / XenoLinux 2.4.22 - kernel /boot/image.gz dom0_mem=100000 - module /boot/xenolinux.gz root=/dev/ram0 rw init=/linuxrc console=xencons0 console=tty0 DOMID=0 - module /boot/initrd.gz - -title Xen / XenoLinux 2.4.22 w/ cmdline IP config -- edit as required - kernel /boot/image.gz dom0_mem=100000 - module /boot/xenolinux.gz ip=192.168.5.5::192.168.0.1:255.255.0.0::eth0:off root=/dev/ram0 rw init=/linuxrc console=xencons0 console=tty0 DOMID=0 - module /boot/initrd.gz - -title Xen / XenoLinux 2.4.22 in "safe mode" - kernel /boot/image.gz ignorebiostables watchdog dom0_mem=100000 - module /boot/xenolinux.gz root=/dev/ram0 rw init=/linuxrc console=xencons0 console=tty0 DOMID=0 - module /boot/initrd.gz - - -title Linux 2.4.22 - kernel /boot/vmlinuz-2.4.22 root=/dev/ram0 rw init=/linuxrc - initrd /boot/initrd.gz - - diff --git a/tools/control/examples/xen-mynewdom b/tools/control/examples/xen-mynewdom deleted file mode 100644 index 009a584e6e..0000000000 --- a/tools/control/examples/xen-mynewdom +++ /dev/null @@ -1,3 +0,0 @@ -domain new -physical grant -pcdrom_link -domain start diff --git a/tools/control/examples/xenctl.xml b/tools/control/examples/xenctl.xml deleted file mode 100644 index 6f1ed1e185..0000000000 --- a/tools/control/examples/xenctl.xml +++ /dev/null @@ -1,17 +0,0 @@ - - -XenoLinux -98304 -/boot/xenolinux.gz -1 -/boot/initrd.gz -/dev/ram0 -rw -init=/linuxrc 4 DOMID=+ -169.254.1.0+ -169.254.1.0 -255.255.0.0 -169.254.1.0 -1000 -/usr/local/bin/ - diff --git a/tools/control/examples/xenctl.xml-dom0nfs b/tools/control/examples/xenctl.xml-dom0nfs deleted file mode 100644 index 547ca862c2..0000000000 --- a/tools/control/examples/xenctl.xml-dom0nfs +++ /dev/null @@ -1,17 +0,0 @@ - - -XenoLinux -98304 -/boot/xenolinux.gz -1 -/dev/nfs -rw -init=/linuxrc 4 DOMID=+ -169.254.1.0+ -169.254.1.0 -255.255.0.0 -169.254.1.0 -169.254.1.0:/local/roots/root+ -1000 -/usr/local/bin/ - diff --git a/tools/control/examples/xenctl.xml-linklocal b/tools/control/examples/xenctl.xml-linklocal deleted file mode 100644 index 6f1ed1e185..0000000000 --- a/tools/control/examples/xenctl.xml-linklocal +++ /dev/null @@ -1,17 +0,0 @@ - - -XenoLinux -98304 -/boot/xenolinux.gz -1 -/boot/initrd.gz -/dev/ram0 -rw -init=/linuxrc 4 DOMID=+ -169.254.1.0+ -169.254.1.0 -255.255.0.0 -169.254.1.0 -1000 -/usr/local/bin/ - diff --git a/tools/control/examples/xenctl.xml-publicip b/tools/control/examples/xenctl.xml-publicip deleted file mode 100644 index fa78a847b1..0000000000 --- a/tools/control/examples/xenctl.xml-publicip +++ /dev/null @@ -1,17 +0,0 @@ - - -XenoLinux -98304 -/boot/xenolinux.gz -1 -/boot/initrd.gz -/dev/ram0 -rw -init=/linuxrc 4 DOMID=+ -=+ -= -= -169.254.1.0 -10 -/usr/local/bin/ - diff --git a/tools/control/src/org/xenoserver/cmdline/CommandParser.java b/tools/control/src/org/xenoserver/cmdline/CommandParser.java deleted file mode 100644 index af8adfe268..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/CommandParser.java +++ /dev/null @@ -1,142 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.PartitionManager; -import org.xenoserver.control.Settings; -import org.xenoserver.control.VirtualDiskManager; -import org.xenoserver.control.XML; - -/** - * Subclasses of Parser know how to parse arguments for a given command - * and execute it, displaying any output. - */ -public abstract class CommandParser { - /** - * Subclasses should implement this method such that it outputs any successful - * output to the screen, or throws an exception if required arguments - * are missing or malformed. It also may propagate exceptions from the - * command execution. - * - * @param d The defaults object to use. - * @param args The arguments to parse. - * @throws ParseFailedException if the arguments are not suitable. - * @throws CommandFailedException if the command did not execute successfully. - */ - public abstract void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException; - - /** @return The command name which will be matched on the command line. */ - public abstract String getName(); - /** @return A usage string for this command. */ - public abstract String getUsage(); - /** @return The help text for this command. */ - public abstract String getHelpText(); - - /** - * Print a usage string for this command. - * @param prefix The command prefix for this command - */ - public void printUsage(String prefix) { - String name = getName(); - if (prefix != null) { - name = prefix + " " + name; - } - String usage = getUsage(); - while (name.length() < 16) { - name = name + " "; - } - System.out.println(" " + name + usage); - } - - /** - * Prints the help text for this command. - * @param args Command arguments, ignored for normal commands. - */ - public void printHelpText(LinkedList args) { - System.out.println(getName() + " " + getUsage()); - System.out.println(); - System.out.println(getHelpText()); - } - - /** - * Get a string parameter - * @param args Argument list to search - * @param key Argument key - * @param def Default value - * @return parameter, or default if none found - */ - public String getStringParameter(List args, char key, String def) { - String r = getParameter(args, key); - return (r == null) ? def : r; - } - - /** - * Get an int parameter - * @param args Argument list to search - * @param key Argument key - * @param def Default value - * @return parameter, or default if none found - */ - public int getIntParameter(List args, char key, int def) { - String r = getParameter(args, key); - return (r == null) ? def : (Integer.parseInt(r.trim())); - } - - /** - * Get a boolean parameter - * @param args Argument list to search - * @param key Argument key - * @return parameter, or false if none found - */ - public boolean getFlagParameter(List args, char key) { - String r = getParameter(args, key); - return (r == null) ? false : true; - } - - /** - * Get a parameter - * @param args Argument list to search - * @param key Key to look for - * @return Value, or "" if no value, or null if no such argument - */ - protected String getParameter(List args, char key) { - String result = null; - Iterator i = args.iterator(); - while (i.hasNext()) { - String arg = (String) i.next(); - if (arg.startsWith("-" + key)) { - if (arg.length() > 2) { - result = arg.substring(2); - } else { - result = ""; - } - } - } - return result; - } - - /** - * Load the partition and disk manager state - */ - protected void loadState() { - XML.loadState( - PartitionManager.IT, - VirtualDiskManager.IT, - Settings.STATE_INPUT_FILE); - } - - /** - * Save the partition and disk manager state - */ - protected void saveState() { - XML.saveState( - PartitionManager.IT, - VirtualDiskManager.IT, - Settings.STATE_OUTPUT_FILE); - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/Main.java b/tools/control/src/org/xenoserver/cmdline/Main.java deleted file mode 100644 index cada1a10b8..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/Main.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; -import java.util.NoSuchElementException; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; - -/** - * Main class for the command-line xenctl interface. - */ -public class Main { - static final ParseHelp help = new ParseHelp(); - private static final CommandParser domaincommands[] = - { new ParseDomainNew(), - new ParseDomainStart(), - new ParseDomainStop(), - new ParseDomainDestroy(), - new ParseDomainList() - }; - private static final CommandParser partitioncommands[] = - { new ParsePartitionsAdd(), - new ParsePartitionsList() - }; - private static final CommandParser physicalcommands[] = - { new ParsePhysicalGrant(), - new ParsePhysicalRevoke(), - new ParsePhysicalList() - }; - private static final CommandParser vdcommands[] = - { new ParseVdCreate(), - new ParseVdDelete(), - new ParseVdRefresh(), - new ParseVdShow(), - new ParseVdFree() - }; - private static final CommandParser vbdcommands[] = - { new ParseVbdCreate(), - new ParseVbdShow() - }; - private static final CommandParser commands[] = - { help, - new ParseGroup( "domain", domaincommands ), - new ParseGroup( "partitions", partitioncommands ), - new ParseGroup( "physical", physicalcommands ), - new ParseScript(), - new ParseGroup( "vd", vdcommands ), - new ParseGroup( "vbd", vbdcommands ) - }; - /** The top-level parser. */ - static final CommandParser parser = new ParseGroup( null, commands ); - - public static void executeArgList (Defaults d, LinkedList arglist) - throws ParseFailedException, CommandFailedException - { - if (arglist.size() == 0) { - help.parse(null, null); - } else { - parser.parse(d, arglist); - } - } - - public static void main(String[] args) { - Defaults d = new Defaults(); - int ec = -1; - LinkedList arglist = new LinkedList(); - boolean seen_arg = false; - String collected = null; - for ( int i=0; i"); - } - - String output = new CommandDomainDestroy(d, domain_id, force).execute(); - if (output != null) { - System.out.println(output); - } - } - - public String getName() { - return "destroy"; - } - - public String getUsage() { - return "[-n] [-f]"; - } - - public String getHelpText() { - return "Destroy the specified domain. -f forcibly destroys it."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseDomainList.java b/tools/control/src/org/xenoserver/cmdline/ParseDomainList.java deleted file mode 100644 index 4d3a1fecf1..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainList.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandDomainList; -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Domain; - -public class ParseDomainList extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - CommandDomainList list = new CommandDomainList(d); - String output = list.execute(); - if (output != null) { - System.out.println(output); - } - - Domain[] domains = list.domains(); - - for (int loop = 0; loop < domains.length; loop++) { - System.out.println( - "id: " + domains[loop].id + " (" + domains[loop].name + ")"); - System.out.println(" processor: " + domains[loop].processor); - System.out.println(" has cpu: " + domains[loop].cpu); - System.out.println( - " state: " + domains[loop].nstate + " " + domains[loop].state); - System.out.println(" mcu advance: " + domains[loop].mcu); - System.out.println(" total pages: " + domains[loop].pages); - } - } - - public String getName() { - return "list"; - } - - public String getUsage() { - return ""; - } - - public String getHelpText() { - return "List domain information and status."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java b/tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java deleted file mode 100644 index a59fe48030..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandDomainNew; -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandPhysicalGrant; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Mode; -import org.xenoserver.control.StringPattern; - -public class ParseDomainNew extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - String name = getStringParameter(args, 'n', d.domainName); - int size = getIntParameter(args, 'k', d.domainSizeKB); - String image = getStringParameter(args, 'i', d.domainImage); - String initrd = getStringParameter(args, 'r', d.domainInitRD); - int vifs = getIntParameter(args, 'v', d.domainVIFs); - String bargs = getStringParameter(args, 'a', d.args); - String root_dev = getStringParameter(args, 'd', d.rootDevice); - String root_args = getStringParameter(args, 't', d.rootArgs); - String usr_dev = getStringParameter(args, 'u', d.usrDevice); - String nfs_root_path = getStringParameter(args, 'f', d.nwNFSRoot); - String nw_ip = getStringParameter(args, '4', d.nwIP); - String nw_gw = getStringParameter(args, 'g', d.nwGateway); - String nw_mask = getStringParameter(args, 'm', d.nwMask); - String nw_nfs_server = getStringParameter(args, 's', d.nwNFSServer); - String nw_host = getStringParameter(args, 'h', d.nwHost); - int subst = getIntParameter(args, 'x', -1); - - d.describe(); - - CommandDomainNew c = - new CommandDomainNew( - d, - name, - size, - image, - initrd, - vifs, - bargs, - root_dev, - root_args, - nfs_root_path, - nw_ip, - nw_gw, - nw_mask, - nw_nfs_server, - nw_host, - usr_dev, - subst); - c.execute(); - String[] output = c.output(); - for (int i = 0; i < output.length; i++) { - System.out.println(output[i]); - } - - if (root_dev.startsWith("/dev/sda") || root_dev.startsWith("/dev/hda")) { - String real_root = StringPattern.parse(root_dev).resolve(c.domain_id()); - String device = real_root.substring(real_root.indexOf('/',1)+1); - CommandPhysicalGrant cg = new CommandPhysicalGrant(d,c.domain_id(),device,Mode.READ_WRITE,false,subst); - String output2 = cg.execute(); - if ( output2 != null ) { - System.out.println(output2); - } - } - - if (usr_dev != null && ((usr_dev.startsWith("/dev/sda")) || usr_dev.startsWith("/dev/hda"))) { - String real_usr = StringPattern.parse(usr_dev).resolve(c.domain_id()); - String device = real_usr.substring(real_usr.indexOf('/',1)+1); - CommandPhysicalGrant cg = new CommandPhysicalGrant(d,c.domain_id(),device,Mode.READ_ONLY,false,subst); - String output2 = cg.execute(); - if ( output2 != null ) { - System.out.println(output2); - } - } - } - - public String getName() { - return "new"; - } - - public String getUsage() { - return "[-n] [-k] [-i] [-v] [-r] [-d] [-t] [-u] [-f] [-s] [-4] [-g] [-m] [-h] [-a] [-x]"; - } - - public String getHelpText() { - return "Create a new domain. Note that most of the parameters will assume\n" - + "default values: it should not be necessary to specify them all. See\n" - + "xenctl.xml for the current default settings.\n" - + "\n" - + "General command line options:\n" - + " -n Domain name domain_name\n" - + " -k Domain size (kb) domain_size_kb\n" - + " -i Domain image name domain_image\n" - + " -v Number of VIFs domain_vifs\n" - + " -r InitRD (if required) domain_init_rd\n" - + " -d Root device (e.g /dev/nfs, /dev/hda3) root_device\n" - + " -t Root mount args (e.g ro) root_args\n" - + " -u Usr dev/path (e.g /dev/hda3, server:path)usr_device\n" - + " -a Additional boot parameters args\n" - + " -x Number to substitute for + if not domain id\n" - + "\n" - + "Networking options:\n" - + " -f NFS root (if /dev/nfs specified) nw_nfs_root\n" - + " -s NFS server nw_nfs_server\n" - + " -4 Domain IPv4 address nw_ip\n" - + " -g Domain gateway nw_gw\n" - + " -m Domain net mask nw_mask\n" - + " -h Domain hostname nw_host\n" - + "\n" - + "Parameters to -d, -f, -4, -g, -h can be specified as patterns into\n" - + "which the allocated domain ID will be incorporated. e.g. for\n" - + "domain 1 patterns would expand as follows:\n" - + "\n" - + " /dev/hda+ /dev/hda1\n" - + " /dev/hda7+ /dev/hda8\n" - + " 128.232.8.50+ 128.232.8.51\n" - + "\n" - + "Additionally, patterns for -4 -g -m can include an = which is\n" - + "expanded to the corresponding setting from the calling domain.\n"; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java b/tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java deleted file mode 100644 index 4b676f568b..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandDomainStart; -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; - -public class ParseDomainStart extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - int domain_id = getIntParameter(args, 'n', d.domainNumber); - - if (domain_id == 0) { - throw new ParseFailedException("Expected -n"); - } - - String output = new CommandDomainStart(d, domain_id).execute(); - if (output != null) - System.out.println(output); - } - - public String getName() { - return "start"; - } - - public String getUsage() { - return "[-n]"; - } - - public String getHelpText() { - return "Start the specified domain."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java b/tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java deleted file mode 100644 index e4727b33e3..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandDomainStop; -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; - -public class ParseDomainStop extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - int domain_id = getIntParameter(args, 'n', d.domainNumber); - - if (domain_id == 0) { - throw new ParseFailedException("Expected -n"); - } - - String output = new CommandDomainStop(d, domain_id).execute(); - if (output != null) - System.out.println(output); - } - - public String getName() { - return "stop"; - } - - public String getUsage() { - return "[-n]"; - } - - public String getHelpText() { - return "Stop the specified domain."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseFailedException.java b/tools/control/src/org/xenoserver/cmdline/ParseFailedException.java deleted file mode 100644 index 4f084cdb9b..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseFailedException.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.xenoserver.cmdline; - -/** - * Thrown when a command line could not be parsed. - */ -public class ParseFailedException extends Exception { - public ParseFailedException(String message) { - super(message); - } - - public ParseFailedException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseGroup.java b/tools/control/src/org/xenoserver/cmdline/ParseGroup.java deleted file mode 100644 index b57e010ea7..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseGroup.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; - -/** - * Parses a group of commands; taking the first argument, it searches its - * array of commands until it finds a match, and then, removing the matched - * argument from the command line, invokes it. This allows hierarchical - * parsing. - */ -public class ParseGroup extends CommandParser { - /** Name of this group, i.e. the prefix to the command line */ - private final String name; - /** The commands this group will attempt to match its arguments against. */ - private final CommandParser[] commands; - - /** - * Constructor for ParseGroup. - * @param name Name of this group of commands - * @param commands Array of commands to include - */ - public ParseGroup(String name, CommandParser[] commands) { - this.name = name; - this.commands = commands; - } - - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - if (args.isEmpty()) { - Main.help.parse(null,null); - return; - } - - int i; - String c = (String) args.removeFirst(); - for (i = 0; i < commands.length; i++) { - if (commands[i].getName().equals(c)) { - if (!args.isEmpty() && args.getFirst().equals("-?")) { - commands[i].printHelpText(null); - } else { - commands[i].parse(d, args); - } - break; - } - } - if (i == commands.length) { - throw new ParseFailedException("Unknown command " + c); - } - } - - public String getName() { - return name; - } - - public String getUsage() { - return null; - } - - public String getHelpText() { - return null; - } - - public void printUsage(String prefix) { - if (prefix == null) { - prefix = name; - } else { - prefix += " " + name; - } - for (int i = 0; i < commands.length; i++) { - commands[i].printUsage(prefix); - } - } - - public void printHelpText(LinkedList args) { - if (args == null) { - Main.help.parse(null,null); - return; - } - if (name != null) { - System.out.print(name + " "); - } - int i; - String c = (String) args.removeFirst(); - for (i = 0; i < commands.length; i++) { - if (commands[i].getName().equals(c)) { - commands[i].printHelpText(args); - break; - } - } - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseHelp.java b/tools/control/src/org/xenoserver/cmdline/ParseHelp.java deleted file mode 100644 index 8106116aaf..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseHelp.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.Defaults; - -public class ParseHelp extends CommandParser { - public void parse(Defaults d, LinkedList args) { - if (args == null || args.isEmpty()) { - System.out.println("Usage:"); - Main.parser.printUsage(null); - } else { - System.out.print("xenctl "); - Main.parser.printHelpText(args); - } - - System.out.println(""); - } - - public String getName() { - return "help"; - } - - public String getUsage() { - return "[]"; - } - - public String getHelpText() { - return "This message, or if a command is specified, help for that command."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java b/tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java deleted file mode 100644 index 4076bcf51f..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandPartitionAdd; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Library; - -public class ParsePartitionsAdd extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - boolean force = getFlagParameter(args, 'f'); - String partition_name = getStringParameter(args, 'p', ""); - String size = getStringParameter(args, 'c', "128M"); - - if (partition_name.equals("")) { - throw new ParseFailedException("Expected -p"); - } - - loadState(); - String output = - new CommandPartitionAdd(partition_name, Library.parseSize(size),force) - .execute(); - if (output != null) { - System.out.println(output); - } - saveState(); - } - - public String getName() { - return "add"; - } - - public String getUsage() { - return "-p [-f] [-c]"; - } - - public String getHelpText() { - return "Add the specified partition to the virtual disk manager's free\n" - + "space. -c changes the default chunk size. -f forces add."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java b/tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java deleted file mode 100644 index 40388a7f5f..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.Iterator; -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Library; -import org.xenoserver.control.Partition; -import org.xenoserver.control.PartitionManager; - -public class ParsePartitionsList extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - loadState(); - Iterator i = PartitionManager.IT.iterator(); - int idx = 1; - System.out.println( - " maj:min " - + " blocks " - + "start sect " - + " num sects " - + "name"); - while (i.hasNext()) { - Partition p = (Partition) i.next(); - - if (p.isXeno()) { - System.out.print("[ "); - } else { - System.out.print(" "); - } - System.out.print(Library.format(idx++, 2, false) + " "); - System.out.print( - Library.format(p.getMajor(), 3, false) - + ":" - + Library.format(p.getMinor(), 3, true) - + " " - + Library.format(p.getBlocks(), 10, false) - + " " - + Library.format(p.getStartSect(), 10, false) - + " " - + Library.format(p.getNumSects(), 10, false) - + " " - + Library.format(p.getName(), 7, true)); - if (p.isXeno()) { - System.out.println("]"); - } else { - System.out.println(); - } - } - } - - public String getName() { - return "list"; - } - - public String getUsage() { - return ""; - } - - public String getHelpText() { - return "List physical partition information. Partitions surrounded by [] are XenoPartitions."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java b/tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java deleted file mode 100644 index f1488cd5eb..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandPhysicalGrant; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Mode; - -public class ParsePhysicalGrant extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - int domain_id = getIntParameter(args, 'n', d.domainNumber); - boolean force = getFlagParameter(args, 'f'); - String partition_name = getStringParameter(args, 'p', ""); - boolean write = getFlagParameter(args, 'w'); - int subst = getIntParameter(args, 'x', -1); - - if (domain_id == 0) { - throw new ParseFailedException("Expected -n"); - } - if (partition_name.equals("")) { - throw new ParseFailedException("Expected -p"); - } - - Mode mode; - if (write) { - mode = Mode.READ_WRITE; - } else { - mode = Mode.READ_ONLY; - } - - // Initialise the partition manager and look up the partition - loadState(); - String output = - new CommandPhysicalGrant(d, domain_id, partition_name, mode, force,subst) - .execute(); - if (output != null) { - System.out.println(output); - } - } - - public String getName() { - return "grant"; - } - - public String getUsage() { - return "-p [-n] [-f] [-w] [-x]"; - } - - public String getHelpText() { - return "Grant the specified domain access to the given partition. -w grants" - + " read-write instead of read-only. -f forcibly grants access."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java b/tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java deleted file mode 100644 index 85e6e5de19..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map.Entry; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandPhysicalList; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Extent; -import org.xenoserver.control.Library; -import org.xenoserver.control.Partition; -import org.xenoserver.control.PartitionManager; - -public class ParsePhysicalList extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - int domain_id = getIntParameter(args, 'n', d.domainNumber); - if (domain_id == 0) { - throw new ParseFailedException("Expected -n"); - } - - // Initialise the partition manager - loadState(); - - CommandPhysicalList list = new CommandPhysicalList(d, domain_id); - String output = list.execute(); - if (output != null) { - System.out.println(output); - } - - System.out.println( - "maj:min " - + " blocks " - + "start sect " - + " num sects " - + "name " - + "access"); - Iterator i = list.extents().entrySet().iterator(); - while (i.hasNext()) { - Entry entry = (Entry) i.next(); - Extent e = (Extent) entry.getKey(); - String mode = entry.getValue().toString(); - Partition p = PartitionManager.IT.getPartition(e); - if (p != null) { - System.out.println( - Library.format(p.getMajor(), 3, false) - + ":" - + Library.format(p.getMinor(), 3, true) - + " " - + Library.format(p.getBlocks(), 10, false) - + " " - + Library.format(p.getStartSect(), 10, false) - + " " - + Library.format(p.getNumSects(), 10, false) - + " " - + Library.format(p.getName(), 7, true) - + " " - + Library.format(mode, 2, true)); - } else { - System.out.println( - Library.format(e.getMajor(), 3, false) - + ":" - + Library.format( - e.getMinor() | e.getPartitionNo(), - 3, - true) - + " " - + " " - + " " - + Library.format(e.getOffset(), 10, false) - + " " - + Library.format(e.getSize(), 10, false) - + " " - + " " - + " " - + Library.format(mode, 2, true)); - } - } - } - - public String getName() { - return "list"; - } - - public String getUsage() { - return "-n"; - } - - public String getHelpText() { - return "List all physical access which the given domain has been granted."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java b/tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java deleted file mode 100644 index a2490256a7..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandPhysicalRevoke; -import org.xenoserver.control.Defaults; - -public class ParsePhysicalRevoke extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - int domain_id = getIntParameter(args, 'n', d.domainNumber); - String partition_name = getStringParameter(args, 'p', ""); - int subst = getIntParameter(args, 'x', -1); - - if (domain_id == 0) { - throw new ParseFailedException("Expected -n"); - } - if (partition_name.equals("")) { - throw new ParseFailedException("Expected -p"); - } - - // Initialise the partition manager and look up the partition - loadState(); - String output = new CommandPhysicalRevoke(d, domain_id, partition_name, subst).execute(); - if (output != null) { - System.out.println(output); - } - } - - public String getName() { - return "revoke"; - } - - public String getUsage() { - return "-p [-n] [-x]"; - } - - public String getHelpText() { - return "Revoke access to the given partition from the specified domain."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseScript.java b/tools/control/src/org/xenoserver/cmdline/ParseScript.java deleted file mode 100644 index 061af93128..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseScript.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.StringTokenizer; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.Reader; -import java.io.InputStreamReader; -import java.io.IOException; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Extent; -import org.xenoserver.control.Library; -import org.xenoserver.control.Settings; -import org.xenoserver.control.VirtualDisk; -import org.xenoserver.control.VirtualDiskManager; - -public class ParseScript extends CommandParser { - public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException { - String filename = getStringParameter(args,'f',null); - - try - { - Reader r; - BufferedReader br; - String next_line; - boolean stdin; - - if (filename == null) { - r = new InputStreamReader (System.in); - stdin = true; - } else { - r = new FileReader (filename); - stdin = false; - } - br = new BufferedReader (r); - - if (stdin) prompt(); - while ((next_line = br.readLine()) != null) - { - StringTokenizer tok = new StringTokenizer(next_line, " "); - LinkedList arglist = new LinkedList(); - while (tok.hasMoreTokens()) { - arglist.add (tok.nextToken ()); - } - Main.executeArgList (d, arglist); - if (stdin) prompt(); - } - } - catch (IOException ioe) - { - throw new ParseFailedException ("Could not read script \"" + filename + "\"", ioe); - } - } - - void prompt() { - System.out.print ("$ "); - System.out.flush (); - } - - public String getName() { - return "script"; - } - - public String getUsage() { - return "[-f]"; - } - - public String getHelpText() { - return ("Execute a series of xenctl command lines found in the specified file\n" + - "(or from standard input if no filename is given). Execution terminates\n" + - "if any command fails. If a command requires a domain ID then, if\n" + - "ommitted, the domain most recently created by the script will be used\n" + - "by default.\n"); - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java b/tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java deleted file mode 100644 index cec289bcf7..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandVbdCreate; -import org.xenoserver.control.CommandVbdCreatePhysical; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Mode; - -public class ParseVbdCreate extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - String vd_key = getStringParameter(args, 'k', ""); - String partition_name = getStringParameter(args, 'p', ""); - int domain_id = getIntParameter(args, 'n', d.domainNumber); - int vbd_num = getIntParameter(args, 'v', -1); - boolean write = getFlagParameter(args, 'w'); - int subst = getIntParameter(args, 'x', -1); - - if (vd_key.equals("") && partition_name.equals("")) { - throw new ParseFailedException("Expected -k or -p"); - } - if (vbd_num == -1) { - throw new ParseFailedException("Expected -v"); - } - - Mode mode; - if (write) { - mode = Mode.READ_WRITE; - } else { - mode = Mode.READ_ONLY; - } - - loadState(); - String output; - if (vd_key.equals("")) { - output = new CommandVbdCreatePhysical(d, partition_name, domain_id, vbd_num, mode, subst ).execute(); - } else { - output = - new CommandVbdCreate(vd_key, domain_id, vbd_num, mode).execute(); - } - if (output != null) { - System.out.println(output); - } - saveState(); - } - - public String getName() { - return "create"; - } - - public String getUsage() { - return "{-k|-p [-n] [-w] [-x]"; - } - - public String getHelpText() { - return "Create a new virtual block device binding the virtual disk with\n" - + "the specified key to the domain and VBD number given. Add -w to\n" - + "allow read-write access."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java b/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java deleted file mode 100644 index b35c9e068d..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandVbdList; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Library; -import org.xenoserver.control.VirtualBlockDevice; - -public class ParseVbdShow extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - loadState(); - CommandVbdList list = new CommandVbdList(); - list.execute(); - VirtualBlockDevice[] vbds = list.vbds(); - System.out.println("key dom vbd mode"); - for (int i=0; i"); - } - if (size_s.equals("")) { - throw new ParseFailedException("Expected -s"); - } - if (expiry_s.equals("")) { - expiry = null; - } else { - DateFormat format = DateFormat.getDateTimeInstance(); - try { - expiry = format.parse(expiry_s); - } catch (ParseException e) { - throw new ParseFailedException("Could not parse date"); - } - } - - long size = Library.parseSize(size_s); - - loadState(); - String output = new CommandVdCreate(name, size, expiry).execute(); - if (output != null) { - System.out.println(output); - } - saveState(); - } - - public String getName() { - return "create"; - } - - public String getUsage() { - return "-n -s [-e]"; - } - - public String getHelpText() { - return "Create a new virtual disk with the specified parameters"; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java b/tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java deleted file mode 100644 index 842f977871..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandVdDelete; -import org.xenoserver.control.Defaults; - -public class ParseVdDelete extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - String vd_key = getStringParameter(args, 'k', ""); - boolean force = getFlagParameter(args,'f'); - - if (vd_key.equals("")) { - throw new ParseFailedException("Expected -k"); - } - - loadState(); - String output = new CommandVdDelete(vd_key,force).execute(); - if (output != null) { - System.out.println(output); - } - - saveState(); - } - - public String getName() { - return "delete"; - } - - public String getUsage() { - return "-k [-f]"; - } - - public String getHelpText() { - return "Deletes the virtual disk with the specified key. -f forces deletion even if the disk is in use."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVdFree.java b/tools/control/src/org/xenoserver/cmdline/ParseVdFree.java deleted file mode 100644 index bd7826bfab..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdFree.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.Iterator; -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Extent; -import org.xenoserver.control.Library; -import org.xenoserver.control.Settings; -import org.xenoserver.control.VirtualDisk; -import org.xenoserver.control.VirtualDiskManager; - -public class ParseVdFree extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - boolean verbose = getFlagParameter(args, 'v'); - - loadState(); - VirtualDisk free = VirtualDiskManager.IT.getFreeDisk(); - System.out.println( - "Free disk has " - + free.getExtentCount() - + " extents totalling " - + Library.formatSize( - free.getSize() * Settings.SECTOR_SIZE, - 8, - true)); - if (verbose) { - Iterator i = free.extents(); - System.out.println(" disk offset size"); - while (i.hasNext()) { - Extent e = (Extent) i.next(); - System.out.println( - Library.format(e.getDisk(), 6, false) - + " " - + Library.format(e.getOffset(), 12, false) - + " " - + Library.format(e.getSize(), 12, false)); - } - } - } - - public String getName() { - return "free"; - } - - public String getUsage() { - return "[-v]"; - } - - public String getHelpText() { - return "Show free space allocated to virtual disk manager. -v enables verbose output."; - } -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java b/tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java deleted file mode 100644 index e578099e53..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.xenoserver.cmdline; - -import java.text.DateFormat; -import java.text.ParseException; -import java.util.Date; -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.CommandVdRefresh; -import org.xenoserver.control.Defaults; - -public class ParseVdRefresh extends CommandParser { - public void parse(Defaults d, LinkedList args) - throws ParseFailedException, CommandFailedException { - String vd_key = getStringParameter(args, 'k', ""); - String expiry_s = getStringParameter(args, 'e', ""); - Date expiry; - - if (vd_key.equals("")) { - throw new ParseFailedException("Expected -k"); - } - if (expiry_s.equals("")) { - expiry = null; - } else { - DateFormat format = DateFormat.getDateTimeInstance(); - try { - expiry = format.parse(expiry_s); - } catch (ParseException e) { - throw new ParseFailedException("Could not parse date"); - } - } - - loadState(); - String output = new CommandVdRefresh(vd_key, expiry).execute(); - if (output != null) { - System.out.println(output); - } - saveState(); - } - - public String getName() { - return "refresh"; - } - - public String getUsage() { - return "-k [-e]"; - } - - public String getHelpText() { - return "Refresh the expiry for the specified virtual disk. Omitting -e will cause the disk to never expire."; - } - -} diff --git a/tools/control/src/org/xenoserver/cmdline/ParseVdShow.java b/tools/control/src/org/xenoserver/cmdline/ParseVdShow.java deleted file mode 100644 index a833d26405..0000000000 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdShow.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.xenoserver.cmdline; - -import java.util.Iterator; -import java.util.LinkedList; - -import org.xenoserver.control.CommandFailedException; -import org.xenoserver.control.Defaults; -import org.xenoserver.control.Extent; -import org.xenoserver.control.Library; -import org.xenoserver.control.Settings; -import org.xenoserver.control.VirtualDisk; -import org.xenoserver.control.VirtualDiskManager; - -public class ParseVdShow extends CommandParser { - public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException { - String key = getStringParameter(args,'k',""); - - loadState(); - - if ( key.equals("") ) { - System.out.println("key expiry name size"); - Iterator i = VirtualDiskManager.IT.getVirtualDisks(); - while ( i.hasNext() ) { - VirtualDisk vd = (VirtualDisk) i.next(); - System.out.print( vd.getKey() + " " ); - if ( vd.getExpiry() != null ) { - System.out.print( vd.getExpiry().toString() ); - } else { - System.out.print( " " ); - } - System.out.println( " " + Library.format(vd.getName(),16,true) + " " - + Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) ); - } - } else { - VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(key); - if ( vd == null ) { - throw new CommandFailedException("There is no virtual disk " + key ); - } - - System.out.println(" name: " + vd.getName()); - System.out.println(" key: " + vd.getKey()); - System.out.println(" size: " + Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,true)); - if ( vd.getExpiry() != null ) { - System.out.println("expiry: " + vd.getExpiry()); - } - System.out.println(); - - Iterator i = vd.extents(); - System.out.println(" disk offset size"); - while (i.hasNext()) { - Extent e = (Extent) i.next(); - System.out.println( Library.format(e.getDisk(), 6, false) + " " - + Library.format(e.getOffset(), 12, false) + " " - + Library.format(e.getSize(), 12, false) ); - } - } - } - - public String getName() { - return "show"; - } - - public String getUsage() { - return "[-k]"; - } - - public String getHelpText() { - return "Show a summary of all virtual disks, or details of one disk if -k is given"; - } -} diff --git a/tools/control/src/org/xenoserver/control/Command.java b/tools/control/src/org/xenoserver/control/Command.java deleted file mode 100644 index 682b43bab5..0000000000 --- a/tools/control/src/org/xenoserver/control/Command.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.xenoserver.control; - -/** - * Subclasses of Command are responsible for applying changes to domain - * and virtual disk settings. - */ -public abstract class Command { - /** - * Subclasses should define an execute method which will apply the - * relevant change, if possible. - * - * @return The results of executing the command, if successful, or null if - * the command does not need to return results. - * @throws CommandFailedException if the command could not be completed. - */ - public abstract String execute() throws CommandFailedException; - - /** - * Wraps execute() suitable for the web interface: all exceptions are - * converted into output strings. - * @return Output string, whether command succeeded or not. - */ - public String executeWeb() { - try { - return execute(); - } catch (CommandFailedException e) { - return e.getMessage(); - } - } - - /** - * Construct a string to report the execution of a command. - * @param cmd_array The array of command parameters. - * @return The report string. - */ - protected String reportCommand(String[] cmd_array) { - StringBuffer sb = new StringBuffer(); - int i; - for (i = 0; i < cmd_array.length; i++) { - sb.append(cmd_array[i] + " "); - } - return sb.toString(); - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandDomainDestroy.java b/tools/control/src/org/xenoserver/control/CommandDomainDestroy.java deleted file mode 100644 index 7d9f0a8cd3..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandDomainDestroy.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.xenoserver.control; - -/** - * Destroys a domain. - */ -public class CommandDomainDestroy extends Command { - /** Defaults instance in use. */ - private Defaults d; - /** Domain ID to destroy. */ - private int domain_id; - /** Force destruction? */ - private boolean force; - - /** - * Constructor for CommandDomainDestroy. - * - * @param d Defaults object to use. - * @param domain_id Domain ID number to destroy. - * @param force Force destruction. - */ - public CommandDomainDestroy(Defaults d, int domain_id, boolean force) { - this.d = d; - this.domain_id = domain_id; - this.force = force; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - String output = null; - - try { - Process destroy_p; - String destroy_cmdarray[] = force ? new String[3] : new String[2]; - int destroy_rc; - int idx = 0; - destroy_cmdarray[idx++] = d.xiToolsDir + "xi_destroy"; - if (force) { - destroy_cmdarray[idx++] = "-f"; - } - destroy_cmdarray[idx++] = "" + domain_id; - - if (Settings.TEST) { - output = reportCommand(destroy_cmdarray); - } else { - destroy_p = r.exec(destroy_cmdarray); - destroy_rc = destroy_p.waitFor(); - - if (destroy_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not destroy domain", - destroy_cmdarray); - } - output = "Destroyed domain " + domain_id; - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not destroy domain (" + e + ")", - e); - } - - return output; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandDomainList.java b/tools/control/src/org/xenoserver/control/CommandDomainList.java deleted file mode 100644 index 98caac9016..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandDomainList.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.xenoserver.control; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.StringTokenizer; -import java.util.Vector; - -/** - * Lists details of all domains. After execute() has been called, call - * domains() to get the array of domains. - */ -public class CommandDomainList extends Command { - /** Defaults instance in use. */ - private Defaults d; - /** Array of domains returned. */ - private Domain[] array; - - /** - * Constructor for CommandDomainList. - * @param d Defaults object to use. - */ - public CommandDomainList(Defaults d) { - this.d = d; - } - - /** - * Retrieves the list of domains. - * @return null, call domains() to get the list. - * @throws CommandFailedException if the list could not be retrieved. - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - Vector v = new Vector(); - String outline; - BufferedReader in; - String output = null; - - try { - Process start_p; - String start_cmdarray[] = new String[1]; - int start_rc; - start_cmdarray[0] = d.xiToolsDir + "xi_list"; - - if (Settings.TEST) { - output = reportCommand(start_cmdarray); - } else { - start_p = r.exec(start_cmdarray); - start_rc = start_p.waitFor(); - if (start_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not get domain list", - start_cmdarray); - } - - in = - new BufferedReader( - new InputStreamReader(start_p.getInputStream())); - - outline = in.readLine(); - while (outline != null) { - Domain domain = new Domain(); - - StringTokenizer st = new StringTokenizer(outline); - if (st.hasMoreTokens()) { - domain.id = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - domain.processor = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - if (st.nextToken().equals("1")) { - domain.cpu = true; - } else { - domain.cpu = false; - } - } - if (st.hasMoreTokens()) { - domain.nstate = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - domain.state = st.nextToken().toLowerCase(); - } - if (st.hasMoreTokens()) { - domain.ev = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - domain.mcu = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - domain.pages = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - domain.name = st.nextToken(); - } - - v.add(domain); - - outline = in.readLine(); - } - - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not get domain list(" + e + ")", - e); - } - - array = new Domain[v.size()]; - v.toArray(array); - return output; - } - - /** - * @return Array of domains. - */ - public Domain[] domains() { - return array; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandDomainNew.java b/tools/control/src/org/xenoserver/control/CommandDomainNew.java deleted file mode 100644 index 10fa06b869..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandDomainNew.java +++ /dev/null @@ -1,413 +0,0 @@ -package org.xenoserver.control; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.lang.NumberFormatException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.zip.GZIPInputStream; - -/** - * Creates a new domain. As this command returns a multi-line result, - * call output() to get an array of strings. - */ -public class CommandDomainNew extends Command { - /** Defaults instance in use. */ - private Defaults d; - /** Name of new domain. */ - private String name; - /** Memory size for new domain. */ - private int size; - /** Kernel image */ - private String image; - /** Initial ramdisk */ - private String initrd; - /** Num of virtual interfaces */ - private int vifs; - /** Boot arguments */ - private String bargs; - /** Root device */ - private String root_dev; - /** Root mount args */ - private String root_args; - /** Usr device */ - private String usr_dev; - /** NFS root path */ - private String nfs_root_path; - /** IP address */ - private String nw_ip; - /** Gateway */ - private String nw_gw; - /** netmask */ - private String nw_mask; - /** NFS server */ - private String nw_nfs_server; - /** Hostname */ - private String nw_host; - /** Output from domain creation */ - private String[] output; - /** Domain ID created. */ - private int domain_id; - /** Number to substitute for + (-1 => use domain_id) */ - private int subst; - - /** - * @return Output from domain creation. - */ - public String[] output() { - return output; - } - - /** - * @return The domain id this command created. - */ - public int domain_id() { - return domain_id; - } - - /** - * Constructor for CommandDomainNew. - * @param d Defaults object to use. - * @param name Name for the domain. - * @param size Memory size for the domain. - * @param image Image to boot domain from. - * @param initrd Initrd to boot domain with. - * @param vifs Number of virtual interfaces for the domain. - * @param bargs Boot arguments for the domain. - * @param root_dev Root device for the domain. - * @param nfs_root_path NFS root to be used by the domain. - * @param nw_ip IP address pattern to use for the domain's interfaces. - * @param nw_gw Gateway to configure the domain for. - * @param nw_mask Network mask to configure the domain for. - * @param nw_nfs_server NFS server to be used by the domain. - * @param nw_host Hostname to be used by the domain. - */ - public CommandDomainNew( - Defaults d, - String name, - int size, - String image, - String initrd, - int vifs, - String bargs, - String root_dev, - String root_args, - String nfs_root_path, - String nw_ip, - String nw_gw, - String nw_mask, - String nw_nfs_server, - String nw_host, - int subst) { - this(d,name,size,image,initrd,vifs,bargs,root_dev,root_args,nfs_root_path,nw_ip,nw_gw,nw_mask,nw_nfs_server,nw_host,null,subst); - } - - public CommandDomainNew( - Defaults d, - String name, - int size, - String image, - String initrd, - int vifs, - String bargs, - String root_dev, - String root_args, - String nfs_root_path, - String nw_ip, - String nw_gw, - String nw_mask, - String nw_nfs_server, - String nw_host, - String usr_dev, - int subst) { - this.d = d; - this.name = name; - this.size = size; - this.image = image; - this.initrd = initrd; - this.vifs = vifs; - this.bargs = bargs; - this.root_dev = root_dev; - this.root_args = root_args; - this.nfs_root_path = nfs_root_path; - this.nw_ip = nw_ip; - this.nw_gw = nw_gw; - this.nw_mask = nw_mask; - this.nw_nfs_server = nw_nfs_server; - this.nw_host = nw_host; - this.usr_dev = usr_dev; - this.subst = subst; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - int domain_id = -1; - BufferedReader br; - int idx; - int i; - File image_tmp = null; - File initrd_tmp = null; - String domain_ip = ""; - - String create_cmdarray[] = new String[3]; - String build_cmdarray[] = new String[6]; - String vifinit_cmdarray[] = new String[4]; - - try { - try { - /* Some initial sanity checks */ - if (root_dev.equals("/dev/nfs") && (vifs == 0)) { - throw new CommandFailedException("Cannot use NFS root without VIFs configured"); - } - - /* Uncompress the image and initrd */ - if (image.endsWith(".gz")) { - image_tmp = getUncompressed("xen-image-", image); - image = image_tmp.getPath(); - } - - if (initrd != null && initrd.endsWith(".gz")) { - initrd_tmp = getUncompressed("xen-initrd-", initrd); - initrd = initrd_tmp.getPath(); - } - - /* Create a new empty domain */ - Process create_p; - int create_rc; - create_cmdarray[0] = d.xiToolsDir + "xi_create"; - create_cmdarray[1] = "" + size; - create_cmdarray[2] = name; - if (Settings.TEST) { - reportCommand(create_cmdarray); - domain_id = 1; - create_rc = 0; - } else { - create_p = r.exec(create_cmdarray); - br = - new BufferedReader( - new InputStreamReader(create_p.getInputStream())); - try - { - domain_id = Integer.parseInt(br.readLine()); - } - catch (NumberFormatException nfe) - { - domain_id = -1; - } - create_rc = create_p.waitFor(); - } - d.domainNumber = domain_id; - - if (create_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Failed to create domain", - create_cmdarray); - } else if (domain_id > d.maxDomainNumber) { - throw new CommandFailedException( - "Cannot configure more than " - + d.maxDomainNumber - + " domains"); - } - - if (subst == -1) subst = domain_id; - - /* Set up boot parameters to pass to xi_build. */ - bargs = StringPattern.parse(bargs).resolve(subst) + " "; - if (root_dev.equals("/dev/nfs")) { - if (vifs == 0) { - throw new CommandFailedException("Cannot use NFS root without VIFs configured"); - } - if (nfs_root_path == null) { - throw new CommandFailedException("No NFS root specified"); - } - if (nw_nfs_server == null) { - throw new CommandFailedException("No NFS server specified"); - } - bargs = - (bargs - + " root=/dev/nfs " + StringPattern.parse(root_args).resolve(subst) + " " - + "nfsroot=" - + StringPattern.parse(nfs_root_path).resolve( - subst) - + " "); - } else { - bargs = - (bargs - + " root=" - + StringPattern.parse(root_dev).resolve(subst) - + " " + StringPattern.parse(root_args).resolve(subst) + " "); - - } - - if (usr_dev != null && !usr_dev.equals("")) { - bargs = bargs + " usr=" + StringPattern.parse(usr_dev).resolve(subst) + " "; - } - - if (vifs > 0) { - domain_ip = - InetAddressPattern.parse(nw_ip).resolve(subst); - /* if (nw_host == null) { - try { - nw_host = - InetAddress.getByName(domain_ip).getHostName(); - } catch (UnknownHostException uhe) { - nw_host = "" + nw_ip; - } - - }*/ - bargs = - ("ip=" - + domain_ip - + ":" - + ((nw_nfs_server == null || nw_nfs_server.equals("")) - ? "" - : (InetAddressPattern - .parse(nw_nfs_server) - .resolve(subst))) - + ":" - + ((nw_gw == null || nw_gw.equals("")) - ? "" - : (InetAddressPattern - .parse(nw_gw) - .resolve(subst))) - + ":" - + ((nw_mask == null || nw_mask.equals("")) - ? "" - : InetAddressPattern.parse(nw_mask).resolve( - subst)) - + ":" - + ((nw_host == null) ? "" : nw_host) - + ":eth0:off " - + bargs); - } - - /* Build the domain */ - Process build_p; - int build_rc; - idx = 0; - for (i = 0; i < build_cmdarray.length; i++) { - build_cmdarray[i] = ""; - } - build_cmdarray[idx++] = d.xiToolsDir + "xi_build"; - build_cmdarray[idx++] = "" + domain_id; - build_cmdarray[idx++] = "" + image; - build_cmdarray[idx++] = "" + vifs; - if (initrd != null) { - build_cmdarray[idx++] = "initrd=" + initrd; - } - build_cmdarray[idx++] = "" + bargs; - if (Settings.TEST) { - reportCommand(build_cmdarray); - build_rc = 0; - } else { - build_p = r.exec(build_cmdarray); - build_rc = build_p.waitFor(); - } - - if (build_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Failed to build domain", - build_cmdarray); - } - - /* Set up the first VIF if necessary */ - if (vifs > 0) { - Process vifinit_p; - int vifinit_rc; - vifinit_cmdarray[0] = d.xiToolsDir + "xi_vifinit"; - vifinit_cmdarray[1] = "" + domain_id; - vifinit_cmdarray[2] = "0"; - vifinit_cmdarray[3] = domain_ip; - if (Settings.TEST) { - reportCommand(vifinit_cmdarray); - vifinit_rc = 0; - } else { - vifinit_p = r.exec(vifinit_cmdarray); - vifinit_rc = vifinit_p.waitFor(); - } - - if (vifinit_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Failed to initialise VIF 0", - vifinit_cmdarray); - } - } - } finally { - if (image_tmp != null) { - image_tmp.delete(); - } - if (initrd_tmp != null) { - initrd_tmp.delete(); - } - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - e.printStackTrace(); - throw new CommandFailedException( - "Could not create new domain (" + e + ")", - e); - } - - output = new String[vifs > 0 ? 6 : 4]; - output[0] = "Domain created with arguments:"; - output[1] = ""; - for (i = 0; i < create_cmdarray.length; i++) { - output[1] += create_cmdarray[i] + " "; - } - output[2] = "Domain built with arguments:"; - output[3] = ""; - for (i = 0; i < build_cmdarray.length; i++) { - output[3] += build_cmdarray[i] + " "; - } - if (vifs > 0) { - output[4] = "VIF 0 initialized with arguments:"; - output[5] = ""; - for (i = 0; i < vifinit_cmdarray.length; i++) { - output[5] += vifinit_cmdarray[i] + " "; - } - } - - this.domain_id = domain_id; - - return null; - } - - /** - * Get uncompressed version of file. - * @param prefix Temp file prefix. - * @param original Original filename. - * @return Uncompressed file. - * @throws IOException if decompression failed. - */ - private File getUncompressed(String prefix, String original) - throws IOException { - FileOutputStream fos; - GZIPInputStream gis; - File result; - byte buffer[] = new byte[1024]; - int l; - - result = File.createTempFile(prefix, null); - - try { - fos = new FileOutputStream(result); - gis = new GZIPInputStream(new FileInputStream(original)); - while ((l = gis.read(buffer, 0, buffer.length)) != -1) { - fos.write(buffer, 0, l); - } - } catch (IOException ioe) { - result.delete(); - throw ioe; - } - - return result; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandDomainStart.java b/tools/control/src/org/xenoserver/control/CommandDomainStart.java deleted file mode 100644 index 71ba043043..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandDomainStart.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.xenoserver.control; - -/** - * Starts a domain. - */ -public class CommandDomainStart extends Command { - /** Defaults instance in use. */ - private Defaults d; - /** Domain ID to start */ - private int domain_id; - - /** - * Constructor for CommandDomainStart. - * @param d Defaults object to use. - * @param domain_id Domain to start. - */ - public CommandDomainStart(Defaults d, int domain_id) { - this.d = d; - this.domain_id = domain_id; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - String output = null; - - try { - Process start_p; - String start_cmdarray[] = new String[2]; - int start_rc; - start_cmdarray[0] = d.xiToolsDir + "xi_start"; - start_cmdarray[1] = "" + domain_id; - - if (Settings.TEST) { - output = reportCommand(start_cmdarray); - } else { - start_p = r.exec(start_cmdarray); - start_rc = start_p.waitFor(); - if (start_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not start domain", - start_cmdarray); - } - output = "Started domain " + domain_id; - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not start new domain (" + e + ")", - e); - } - - return output; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandDomainStop.java b/tools/control/src/org/xenoserver/control/CommandDomainStop.java deleted file mode 100644 index 27e111f5dd..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandDomainStop.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.xenoserver.control; - -/** - * Stops a domain. - */ -public class CommandDomainStop extends Command { - /** Defaults instance in use */ - private Defaults d; - /** Domain ID to stop */ - private int domain_id; - - /** - * Constructor for CommandDomainStop. - * @param d The defaults object to use. - * @param domain_id The domain to stop. - */ - public CommandDomainStop(Defaults d, int domain_id) { - this.d = d; - this.domain_id = domain_id; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - String output = null; - - try { - Process stop_p; - String stop_cmdarray[] = new String[2]; - int stop_rc; - stop_cmdarray[0] = d.xiToolsDir + "xi_stop"; - stop_cmdarray[1] = "" + domain_id; - - if (Settings.TEST) { - output = reportCommand(stop_cmdarray); - } else { - stop_p = r.exec(stop_cmdarray); - stop_rc = stop_p.waitFor(); - - if (stop_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not stop domain", - stop_cmdarray); - } - output = "Stopped domain " + domain_id; - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not stop new domain (" + e + ")", - e); - } - - return output; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandFailedException.java b/tools/control/src/org/xenoserver/control/CommandFailedException.java deleted file mode 100644 index e097114da7..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandFailedException.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.xenoserver.control; - -/** - * Thrown to indicate that a command failed to execute. - */ -public class CommandFailedException extends Exception { - /** - * Construct an exception with a message. - * @param message Message to use. - */ - public CommandFailedException(String message) { - super(message); - } - - /** - * Construct an exception with a message and cause. - * @param message Message to use. - * @param cause Throwable cause. - */ - public CommandFailedException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Construct an exception for an XI command failure. - * @param message Message to use - * @param cmd_array Command array used to invoke xi command - * @return Suitable exception. - */ - public static CommandFailedException xiCommandFailed( - String message, - String cmd_array[]) { - StringBuffer sb = new StringBuffer(); - int i; - sb.append(message + " using: "); - for (i = 0; i < cmd_array.length; i++) { - sb.append(cmd_array[i] + " "); - } - return new CommandFailedException(sb.toString()); - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandPartitionAdd.java b/tools/control/src/org/xenoserver/control/CommandPartitionAdd.java deleted file mode 100644 index 37db9dff69..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandPartitionAdd.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.xenoserver.control; - -/** - * Add a disk partition to the VirtualDiskManager as a XenoPartition. - */ -public class CommandPartitionAdd extends Command { - /** True to force creation. */ - private boolean force; - /** Partition to add as a XenoPartition. */ - private String partition_name; - /** Chunk size to split partition into (in bytes). */ - private long chunksize; - - /** - * Constructor for CommandPartitionAdd. - * @param partition_name Partition to add. - * @param chunksize Chunk size to split partition into (in bytes). - * @param force True to force creation. - */ - public CommandPartitionAdd(String partition_name, long chunksize, boolean force) { - this.partition_name = partition_name; - this.chunksize = chunksize; - this.force = force; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Partition p = PartitionManager.IT.getPartition(partition_name); - if (p == null) { - throw new CommandFailedException( - "Partition " + partition_name + " does not exist."); - } - // Check if this partition belongs to the VDM - if (p.isXeno() && !force) { - throw new CommandFailedException("Refusing to add partition as it is already allocated to the virtual disk manager. Use -f if you are sure."); - } - - long size = chunksize / Settings.SECTOR_SIZE; - if ( chunksize <= 0 ) { - throw new CommandFailedException("Chunk size is smaller than sector size."); - } - - VirtualDiskManager.IT.addPartition(p, size); - PartitionManager.IT.addXenoPartition(p); - return "Added partition " + p.getName(); - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java b/tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java deleted file mode 100644 index 2e80e7fbca..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.xenoserver.control; - -/** - * Grant physical access to a partition for a given domain. - */ -public class CommandPhysicalGrant extends Command { - /** Defaults instance to use */ - private Defaults d; - /** Domain ID to grant access for */ - private int domain_id; - /** Partition to grant access to */ - private String partition_name; - /** Access mode to grant */ - private Mode mode; - /** True to force grant */ - private boolean force; - /** Number to substitute for + (-1 => use domain_id) */ - private int subst; - - /** - * Constructor for CommandPhysicalGrant. - * @param d Defaults object to use. - * @param domain_id Domain to grant access for. - * @param partition Partition to grant access to. - * @param mode Access mode to grant. - * @param force True to force grant - */ - public CommandPhysicalGrant( - Defaults d, - int domain_id, - String partition, - Mode mode, - boolean force, - int subst) { - this.d = d; - this.domain_id = domain_id; - this.partition_name = partition; - this.mode = mode; - this.force = force; - this.subst = subst; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - String output = null; - String resolved = StringPattern.parse(partition_name).resolve(subst == -1 ? domain_id : subst); - String resolved2 = d.runCommand(d.xiToolsDir + Settings.XI_HELPER + " expand " + resolved).trim(); - Partition partition = PartitionManager.IT.getPartition(resolved2); - - if ( partition == null ) { - throw new CommandFailedException("Partition " + partition_name + " (resolved to " + resolved2 + ") does not exist."); - } - - // Check if this partition belongs to the VDM - if (partition.isXeno() && !force) { - throw new CommandFailedException("Refusing to grant physical access as the given partition is allocated to the virtual disk manager. Use -f if you are sure."); - } - - try { - Process start_p; - String start_cmdarray[] = new String[7]; - int start_rc; - start_cmdarray[0] = d.xiToolsDir + "xi_phys_grant"; - if (mode == Mode.READ_WRITE) { - start_cmdarray[1] = "rw"; - } else if (mode == Mode.READ_ONLY) { - start_cmdarray[1] = "ro"; - } else { - throw new CommandFailedException( - "Unknown access mode '" + mode + "'"); - } - start_cmdarray[2] = Integer.toString(domain_id); - Extent e = partition.toExtent(); - start_cmdarray[3] = Integer.toString(e.getDisk()); - start_cmdarray[4] = Long.toString(e.getOffset()); - start_cmdarray[5] = Long.toString(e.getSize()); - start_cmdarray[6] = Integer.toString(partition.getPartitionIndex()); - - if (Settings.TEST) { - output = reportCommand(start_cmdarray); - } else { - start_p = r.exec(start_cmdarray); - start_rc = start_p.waitFor(); - if (start_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not grant physical access", - start_cmdarray); - } - output = "Granted physical access to domain " + domain_id; - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not grant physical access (" + e + ")", - e); - } - - return output; - } - -} diff --git a/tools/control/src/org/xenoserver/control/CommandPhysicalList.java b/tools/control/src/org/xenoserver/control/CommandPhysicalList.java deleted file mode 100644 index b4c96f2698..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalList.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.xenoserver.control; - -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -/** - * Lists details of all extents the given domain has access to. - * After execute() has been called, call extents() to get the map of extents - * to modes. - */ -public class CommandPhysicalList extends Command { - /** Domain to list details for */ - private int domain_id; - /** Defaults instance to use. */ - private Defaults d; - /** Map of extents to access modes */ - private Map map = new HashMap(); - - /** - * Constructor for CommandDomainList. - * @param d Defaults object to use. - * @param domain_id Domain ID to query for - */ - public CommandPhysicalList(Defaults d, int domain_id) { - this.d = d; - this.domain_id = domain_id; - } - - /** - * Retrieves the list of extents. - * @return null, call extents() to get the list. - * @throws CommandFailedException if the list could not be retrieved. - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - String outline; - BufferedReader in; - String output = null; - - try { - Process start_p; - String start_cmdarray[] = new String[2]; - int start_rc; - start_cmdarray[0] = d.xiToolsDir + "xi_phys_probe"; - start_cmdarray[1] = Integer.toString(domain_id); - - if (Settings.TEST) { - output = reportCommand(start_cmdarray); - } else { - start_p = r.exec(start_cmdarray); - start_rc = start_p.waitFor(); - if (start_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not get extent list", - start_cmdarray); - } - - in = - new BufferedReader( - new InputStreamReader(start_p.getInputStream())); - - outline = in.readLine(); - while (outline != null) { - int disk = -1; - int partition_no = -1; - long offset = -1; - long size = -1; - - StringTokenizer st = new StringTokenizer(outline); - if (st.hasMoreTokens()) { - disk = Integer.parseInt(st.nextToken(), 16); - } - if (st.hasMoreTokens()) { - partition_no = Integer.parseInt(st.nextToken(), 16); - } - if (st.hasMoreTokens()) { - offset = Long.parseLong(st.nextToken(), 16); - } - if (st.hasMoreTokens()) { - size = Long.parseLong(st.nextToken(), 16); - } - if (st.hasMoreTokens()) { - String mode = st.nextToken(); - Extent extent = new Extent(disk, offset, size, partition_no); - if (mode.equals("rw")) { - map.put(extent, Mode.READ_WRITE); - } else if (mode.equals("r")) { - map.put(extent, Mode.READ_ONLY); - } else { - throw new CommandFailedException( - "Could not parse access mode " + mode); - } - } - - outline = in.readLine(); - } - - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not get extent list(" + e + ")", - e); - } - - return output; - } - - /** - * @return Map of extents to access modes. - */ - public Map extents() { - return map; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java b/tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java deleted file mode 100644 index 983019b891..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.xenoserver.control; - -/** - * Revoke physical access to a partition from a domain. - */ -public class CommandPhysicalRevoke extends Command { - /** Defaults instance to use. */ - private Defaults d; - /** Domain to revoke access from */ - private int domain_id; - /** Partition to revoke access to */ - private String partition_name; - /** Number to substitute for + (-1 => use domain_id) */ - private int subst; - - /** - * Constructor for CommandPhysicalRevoke. - * @param d Defaults object to use. - * @param domain_id Domain to revoke access from. - * @param partition Partition to revoke access to. - */ - public CommandPhysicalRevoke(Defaults d, int domain_id, String partition, int subst) { - this.d = d; - this.domain_id = domain_id; - this.partition_name = partition; - this.subst = subst; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - Runtime r = Runtime.getRuntime(); - String output = null; - String resolved = StringPattern.parse(partition_name).resolve(subst == -1 ? domain_id : subst); - String resolved2 = d.runCommand(d.xiToolsDir + Settings.XI_HELPER + " expand " + resolved).trim(); - Partition partition = PartitionManager.IT.getPartition(resolved2); - - if (partition == null) { - throw new CommandFailedException("Partition " + partition_name + " (resolved to " + resolved2 + ") does not exist."); - } - - try { - Process start_p; - String start_cmdarray[] = new String[5]; - int start_rc; - start_cmdarray[0] = d.xiToolsDir + "xi_phys_revoke"; - start_cmdarray[1] = Integer.toString(domain_id); - Extent e = partition.toExtent(); - start_cmdarray[2] = Integer.toString(e.getDisk()); - start_cmdarray[3] = Long.toString(e.getOffset()); - start_cmdarray[4] = Long.toString(e.getSize()); - - if (Settings.TEST) { - output = reportCommand(start_cmdarray); - } else { - start_p = r.exec(start_cmdarray); - start_rc = start_p.waitFor(); - if (start_rc != 0) { - throw CommandFailedException.xiCommandFailed( - "Could not revoke physical access", - start_cmdarray); - } - output = "Revoked physical access from domain " + domain_id; - } - } catch (CommandFailedException e) { - throw e; - } catch (Exception e) { - throw new CommandFailedException( - "Could not revoke physical access (" + e + ")", - e); - } - - return output; - } - -} diff --git a/tools/control/src/org/xenoserver/control/CommandVbdCreate.java b/tools/control/src/org/xenoserver/control/CommandVbdCreate.java deleted file mode 100644 index a1c7c82f15..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandVbdCreate.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.xenoserver.control; - -import java.io.FileWriter; -import java.io.IOException; - -/** - * Create a virtual block device. - */ -public class CommandVbdCreate extends Command { - /** Virtual disk to map to. */ - private String vd_key; - /** Domain to create VBD for. */ - private int domain_id; - /** VBD number to use. */ - private int vbd_num; - /** Access mode to grant. */ - private Mode mode; - - /** - * Constructor for CommandVbdCreate. - * @param vd VirtualDisk to map to. - * @param domain_id Domain to map for. - * @param vbd_num VBD number within domain. - * @param mode Access mode to grant. - */ - public CommandVbdCreate( - String vd, - int domain_id, - int vbd_num, - Mode mode) { - this.vd_key = vd; - this.domain_id = domain_id; - this.vbd_num = vbd_num; - this.mode = mode; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(vd_key); - if (vd == null) { - throw new CommandFailedException( - "No virtual disk with key " + vd_key); - } - - VirtualBlockDevice vbd = - new VirtualBlockDevice( - vd, - domain_id, - vbd_num, - mode); - String command = vd.dumpForXen(vbd); - - try { - FileWriter fw = new FileWriter("/proc/xeno/vhd"); - fw.write(command); - fw.flush(); - fw.close(); - } catch (IOException e) { - throw new CommandFailedException("Could not write VBD details to /proc/xeno/vhd", e); - } - - return "Created virtual block device " - + vbd_num - + " for domain " - + domain_id; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java b/tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java deleted file mode 100644 index 186514a4f0..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.xenoserver.control; - -import java.io.FileWriter; -import java.io.IOException; - -/** - * Create a virtual block device. - */ -public class CommandVbdCreatePhysical extends Command { - /** Defaults instance to use. */ - private Defaults d; - /** Virtual disk to map to. */ - private String partition_name; - /** Domain to create VBD for. */ - private int domain_id; - /** VBD number to use. */ - private int vbd_num; - /** Access mode to grant. */ - private Mode mode; - /** Number to substitute for + (-1 => use domain_id) */ - private int subst; - - /** - * Constructor for CommandVbdCreate. - * @param partition Partition to map to. - * @param domain_id Domain to map for. - * @param vbd_num VBD number within domain. - * @param mode Access mode to grant. - */ - public CommandVbdCreatePhysical( - Defaults d, - String partition, - int domain_id, - int vbd_num, - Mode mode, - int subst) { - this.d = d; - this.partition_name = partition; - this.domain_id = domain_id; - this.vbd_num = vbd_num; - this.mode = mode; - this.subst = subst; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - String resolved = StringPattern.parse(partition_name).resolve(subst == -1 ? domain_id : subst); - String resolved2 = d.runCommand(d.xiToolsDir + Settings.XI_HELPER + " expand " + resolved).trim(); - Partition partition = PartitionManager.IT.getPartition(resolved2); - if (partition == null) { - throw new CommandFailedException( - "No partition " + partition_name + " (resolved to " + resolved2 + ") exists"); - } - - VirtualDisk vd = new VirtualDisk("vbd:" + partition.getName()); - vd.addPartition(partition, partition.getNumSects()); - - VirtualBlockDevice vbd = - new VirtualBlockDevice(vd, domain_id, vbd_num, mode); - - String command = vd.dumpForXen(vbd); - - try { - FileWriter fw = new FileWriter("/proc/xeno/vhd"); - fw.write(command); - fw.flush(); - fw.close(); - } catch (IOException e) { - throw new CommandFailedException( - "Could not write VBD details to /proc/xeno/vhd", - e); - } - - return "Created virtual block device " - + vbd_num - + " for domain " - + domain_id; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandVbdList.java b/tools/control/src/org/xenoserver/control/CommandVbdList.java deleted file mode 100644 index c25191113a..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandVbdList.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.xenoserver.control; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.util.StringTokenizer; -import java.util.Vector; - -public class CommandVbdList extends Command { - /** Array of virtual block devices returned */ - private VirtualBlockDevice[] array; - - public String execute() throws CommandFailedException { - Vector v = new Vector(); - BufferedReader in; - String line; - - try { - in = new BufferedReader(new FileReader("/proc/xeno/vhd")); - line = in.readLine(); - while (line != null) { - int domain = -1; - int vbdnum = -1; - String key = ""; - Mode mode = Mode.READ_ONLY; - - StringTokenizer st = new StringTokenizer(line); - if (st.hasMoreTokens()) { - domain = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - vbdnum = Integer.parseInt(st.nextToken()); - } - if (st.hasMoreTokens()) { - key = st.nextToken(); - } - if (st.hasMoreTokens()) { - if (Integer.parseInt(st.nextToken()) == 1) { - mode = Mode.READ_WRITE; - } - } - - VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(key); - if (vd == null) { - throw new CommandFailedException( - "Key " + key + " has no matching virtual disk"); - } - VirtualBlockDevice vbd = - new VirtualBlockDevice(vd, domain, vbdnum, mode); - v.add(vbd); - - line = in.readLine(); - } - } catch (IOException e) { - throw new CommandFailedException("Could not read VBD file", e); - } - - array = new VirtualBlockDevice[v.size()]; - v.toArray(array); - return null; - } - - public VirtualBlockDevice[] vbds() { - return array; - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandVdCreate.java b/tools/control/src/org/xenoserver/control/CommandVdCreate.java deleted file mode 100644 index d8cdb247d0..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandVdCreate.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.xenoserver.control; - -import java.util.Date; - -/** - * Create a virtual disk. - */ -public class CommandVdCreate extends Command { - /** Name of new disk. */ - private String name; - /** Size of new disk in bytes. */ - private long size; - /** Expiry date of new disk. */ - private Date expiry; - - /** - * Constructor for CommandVdCreate. - * @param name Name of new virtual disk. - * @param size Size in bytes. - * @param expiry Expiry time, or null for never. - */ - public CommandVdCreate(String name, long size, Date expiry) { - this.name = name; - this.size = size; - this.expiry = expiry; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - VirtualDisk vd = - VirtualDiskManager.IT.createVirtualDisk( - name, - size / Settings.SECTOR_SIZE, - expiry); - if (vd == null) { - throw new CommandFailedException("Not enough free space to create disk"); - } - return "Virtual Disk created with key: " + vd.getKey(); - } -} diff --git a/tools/control/src/org/xenoserver/control/CommandVdDelete.java b/tools/control/src/org/xenoserver/control/CommandVdDelete.java deleted file mode 100644 index 2873cd2beb..0000000000 --- a/tools/control/src/org/xenoserver/control/CommandVdDelete.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.xenoserver.control; - -/** - * Delete virtual disk. - */ -public class CommandVdDelete extends Command { - /** Key of disk to delete. */ - private String key; - /** Force deletion? */ - private boolean force; - - /** - * Constructor for CommandVdDelete. - * @param key The key of the disk to delete. - */ - public CommandVdDelete(String key,boolean force) { - this.key = key; - this.force = force; - } - - /** - * @see org.xenoserver.control.Command#execute() - */ - public String execute() throws CommandFailedException { - if (VirtualDiskManager.IT.getVirtualDisk(key) == null) { - throw new CommandFailedException( - "Virtual disk " + key + " does not exist"); - } - if ( !force ) { - CommandVbdList list = new CommandVbdList(); - list.execute(); - VirtualBlockDevice[] vbds = list.vbds(); - for (int i=0;i> 8; - } - - /** - * @return Minor number of disk, not including partition. - */ - public int getMinor() { - return disk & 0xFF; - } - - /** - * @return Partition number of this extent. - */ - public int getPartitionNo() { - return partition_no; - } -} diff --git a/tools/control/src/org/xenoserver/control/InetAddressPattern.java b/tools/control/src/org/xenoserver/control/InetAddressPattern.java deleted file mode 100644 index 90108dd250..0000000000 --- a/tools/control/src/org/xenoserver/control/InetAddressPattern.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.xenoserver.control; - -import java.net.InetAddress; -import java.net.UnknownHostException; - -/** - * This utility class expands configuration file patterns. - */ -public class InetAddressPattern { - /** The base InetAddress for this pattern. */ - private InetAddress base; - /** If true, add the domain number to the base address. */ - private boolean addDom; - - /** - * Parse a pattern string into an InetAddressPattern. - * @param t The pattern string. - * @return The parsed pattern object. - */ - static InetAddressPattern parse(String t) { - InetAddressPattern result = new InetAddressPattern(); - char[] ca = t.toCharArray(); - int len = ca.length; - - try { - if (len == 0) { - result.base = null; - result.addDom = false; - } else if (ca[len - 1] == '+') { - result.base = InetAddress.getByName(t.substring(0, len - 1)); - result.addDom = true; - } else { - result.base = InetAddress.getByName(t); - result.addDom = false; - } - } catch (UnknownHostException uhe) { - result.base = null; - result.addDom = false; - } - - return result; - } - - /** - * Resolve the pattern for the given domain. - * @param domain_id The domain ID. - * @return The resolved string. - */ - String resolve(int domain_id) { - byte[] b = base.getAddress(); - if (addDom) { - if (((int) b[3]) + domain_id > 255) { - if (((int) b[2]) + domain_id > 255) { - if (((int) b[1]) + domain_id > 255) { - b[0]++; - } - b[1]++; - } - b[2]++; - } - b[3] += domain_id; - } - return "" - + (b[0] + (b[0] < 0 ? 256 : 0)) - + "." - + (b[1] + (b[1] < 0 ? 256 : 0)) - + "." - + (b[2] + (b[2] < 0 ? 256 : 0)) - + "." - + (b[3] + (b[3] < 0 ? 256 : 0)); - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return "[" + base + (addDom ? "+dom_id" : "") + "]"; - } -} diff --git a/tools/control/src/org/xenoserver/control/Library.java b/tools/control/src/org/xenoserver/control/Library.java deleted file mode 100644 index eb90218940..0000000000 --- a/tools/control/src/org/xenoserver/control/Library.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Library.java - * 03.03.28 aho creation - */ - -package org.xenoserver.control; - -/** - * Library functions. - */ -public class Library { - /** - * Convert a number to a fixed width string. - * @param input The number to convert. - * @param width The width desired. - * @param leftAlign True to left-align the number. - * @return The formatted string. - */ - public static String format(long input, int width, boolean leftAlign) { - String sss = Long.toString(input); - String space = " "; - - if (width < sss.length()) { - width = sss.length(); - } - - if (leftAlign) { - return sss + space.substring(0, width - sss.length()); - } else { - return space.substring(0, width - sss.length()) + sss; - } - } - - /** - * Convert a string to a fixed-width string. - * @param input Input string. - * @param width Width desired. - * @param leftAlign True to left-align the string. - * @return The formatted string. - */ - public static String format(String input, int width, boolean leftAlign) { - String space = " "; - - if (width < input.length()) { - width = input.length(); - } - - if (leftAlign) { - return input + space.substring(0, width - input.length()); - } else { - return space.substring(0, width - input.length()) + input; - } - } - - /** - * Parse a size which may have a k/m/g suffix into a number. - * @param size The size string to parse. - * @return The equivalent number. - */ - public static long parseSize(String size) { - String substring = size; - int suffix = 1; - long value = 0; - - if (size == null) { - return 0; - } - - if ((substring = check(size, 'm')) != null) { - suffix = 1024 * 1024; - } else if ((substring = check(size, 'M')) != null) { - suffix = 1024 * 1024; - } else if ((substring = check(size, 'k')) != null) { - suffix = 1024; - } else if ((substring = check(size, 'K')) != null) { - suffix = 1024; - } else if ((substring = check(size, 'g')) != null) { - suffix = 1024 * 1024 * 1024; - } else if ((substring = check(size, 'G')) != null) { - suffix = 1024 * 1024 * 1024; - } else { - substring = size; - } - - try { - value = Long.decode(substring).longValue() * suffix; - } catch (NumberFormatException e) { - value = 0; - } - - return value; - } - - /** - * Check if the given size has the specified suffix. - * @param size Size string. - * @param suffix Test suffix. - * @return Number part of string, or null if suffix does not match. - */ - private static String check(String size, char suffix) { - int index = size.indexOf(suffix); - - if (index != -1) { - return size.substring(0, index); - } else { - return null; - } - } - - /** - * Formats a number of bytes in whichever way makes most sense based - * on magnitude and width. - * - * @param size Number of bytes. - * @param width Width of field - at least 5, plz. - * @param leftAlign True for left-align. - * @return The formatted string. - */ - public static String formatSize(long size, int width, boolean leftAlign) { - char[] suffixes = { ' ', 'k', 'M', 'G' }; - int suffix = 0; - long before = size; - float after = 0; - - while (before > 10000) { - after = ((float) (before % 1024)) / 1024; - before /= 1024; - suffix++; - } - - StringBuffer num = new StringBuffer(width); - num.append(Long.toString(before)); - if (after != 0) { - int space = width - num.length() - 2; - if (space > 0) { - num.append('.'); - if (space > 3) { - space = 3; - } - num.append( - Integer.toString((int) (after * Math.pow(10, space)))); - } - } - num.append(suffixes[suffix]); - - return format(num.toString(), width, leftAlign); - } -} diff --git a/tools/control/src/org/xenoserver/control/Mode.java b/tools/control/src/org/xenoserver/control/Mode.java deleted file mode 100644 index e9621604a1..0000000000 --- a/tools/control/src/org/xenoserver/control/Mode.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Mode.java - * 03.03.27 aho creation - * - * until we have jdk1.5, we're left with this mess... - */ - -package org.xenoserver.control; - -/** - * Enumeration to represent an access mode. - */ -public class Mode { - /** name of this mode */ - private final String name; - - /** - * Construct a mode - * @param name Name to use. - */ - private Mode(String name) { - this.name = name; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return name; - } - - /** Single read-only mode instance. */ - public static final Mode READ_ONLY = new Mode("ro"); - /** Single read-write mode instance. */ - public static final Mode READ_WRITE = new Mode("rw"); -} diff --git a/tools/control/src/org/xenoserver/control/Partition.java b/tools/control/src/org/xenoserver/control/Partition.java deleted file mode 100644 index bc1e7e7c09..0000000000 --- a/tools/control/src/org/xenoserver/control/Partition.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Partition.java - * 03.03.26 aho creation - */ - -package org.xenoserver.control; - -import java.io.PrintWriter; - -/** - * Represents a single real partition. - */ -public class Partition { - /** Major device number as seen by Linux. */ - private int major; - /** Minor device number as seen by Linux. */ - private int minor; - /** Number of blocks in the partition. */ - private long blocks; - /** Start sector of the partition. */ - private long start_sect; - /** Number of sectors in the partition. */ - private long nr_sects; - /** Name of the partition. */ - private String name; - /** True if this partition is a XenoPartition. */ - private boolean xeno; - - /** - * Mark this partition as a XenoPartition. - */ - void makeXeno() { - xeno = true; - } - - /** - * Constructor for Partition. - * @param major Major number - * @param minor Minor number - * @param blocks Size in blocks - * @param start_sect Start sector - * @param nr_sects Number of sectors - * @param name Name of partition - * @param xeno True if XenoPartition - */ - Partition( - int major, - int minor, - long blocks, - long start_sect, - long nr_sects, - String name, - boolean xeno) { - this.major = major; - this.minor = minor; - this.blocks = blocks; - this.start_sect = start_sect; - this.nr_sects = nr_sects; - this.name = name; - this.xeno = xeno; - } - - /** - * Dump this partition as XML. - * @param out The writer to dump to. - */ - void dumpAsXML(PrintWriter out) { - out.println( - " \n" - + " " - + major - + "\n" - + " " - + minor - + "\n" - + " " - + blocks - + "\n" - + " " - + start_sect - + "\n" - + " " - + nr_sects - + "\n" - + " " - + name - + "\n" - + " "); - } - - /** - * @return Major device number. - */ - public int getMajor() { - return major; - } - - /** - * @return Minor device number. - */ - public int getMinor() { - return minor; - } - - /** - * @return Number of blocks. - */ - public long getBlocks() { - return blocks; - } - - /** - * @return Starting sector. - */ - public long getStartSect() { - return start_sect; - } - - /** - * @return Number of sectors. - */ - public long getNumSects() { - return nr_sects; - } - - /** - * @return Name of partition. - */ - public String getName() { - return name; - } - - /** - * @return True if this is a XenoPartition. - */ - public boolean isXeno() { - return xeno; - } - - /** - * Is this partition identical to the other? - * @param other Other partition to compare to. - * @return True if they are identical. - */ - boolean identical(Partition other) { - return this.major == other.major - && this.minor == other.minor - && this.blocks == other.blocks - && this.start_sect == other.start_sect - && this.nr_sects == other.nr_sects - && this.name.equals(other.name); - } - - /** - * @return An Extent covering this partiton. - */ - Extent toExtent() { - return new Extent(getDisk(),start_sect,nr_sects); - } - - /** - * @param e Extent to compare this partition to. - * @return True if this partition covers the same disk area as the given extent. - */ - boolean matchesExtent(Extent e) { - return e.getDisk() == getDisk() - && e.getOffset() == start_sect - && e.getSize() == nr_sects; - } - - /** - * @return Disk number for this partition. - */ - public int getDisk() { - if ( name.startsWith("hd") ) { - // High 8 bits are major, low 8 bits are minor, with bottom 6 clear - return (major << 8) | (minor & 0xC0); - } else if ( name.startsWith("sd") ) { - // High 8 bits are major, low 8 bits are minor, with bottom 4 clear - return (major << 8) | (minor & 0xF0); - } else { - throw new IllegalArgumentException("Don't know how to convert " + name + "into a disk number"); - } - } - - /** - * @return Partition index on disk for this partition. - */ - public int getPartitionIndex() { - if ( name.startsWith("hd") ) { - // low 6 bits of minor are partition no - return minor & 0x3F; - } else if ( name.startsWith("sd") ) { - // low 4 bits of minor are partition no - return minor & 0x0F; - } else { - throw new IllegalArgumentException("Don't know how to convert " + name + "into a partition number"); - } - } -} diff --git a/tools/control/src/org/xenoserver/control/PartitionManager.java b/tools/control/src/org/xenoserver/control/PartitionManager.java deleted file mode 100644 index 6180a18f44..0000000000 --- a/tools/control/src/org/xenoserver/control/PartitionManager.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * PartitionManager.java - * 03.03.26 aho creation - */ - -package org.xenoserver.control; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.Vector; - -/** - * PartitionManager manages the partitions on the machine. It is a Singleton - * which automatically initialises itself on first class reference. - */ -public class PartitionManager { - /** The proc header string, used to check that this is a suitable proc file. */ - private static final String PROC_TEMPLATE = - "major minor start_sector num_sectors name"; - - /** The single PartitionManager reference. */ - public static final PartitionManager IT = - new PartitionManager(Settings.PARTITIONS_FILE); - - /** The list of partitions. */ - private Vector partition_map; - - /** - * Initialize partition manager with source file. - * Normally we read from /proc/partitions, but we can - * specify an alternative file for debugging. - * @param filename The file to read partition data from. - */ - private PartitionManager(String filename) { - String str; - BufferedReader in; - - partition_map = new Vector(100, 10); - - try { - in = new BufferedReader(new FileReader(filename)); - - str = in.readLine(); /* skip headings */ - if (str.length() < PROC_TEMPLATE.length() - || !str.substring(0, PROC_TEMPLATE.length()).equals( - PROC_TEMPLATE)) { - System.err.println("Error: Incorrect /proc/partitions."); - System.err.println(" Is this Xeno?"); - System.exit(1); - } - - str = in.readLine(); /* skip blank line */ - - str = in.readLine(); - while (str != null) { - Partition partition = - new Partition( - Integer.parseInt(str.substring( 0, 5).trim()), - Integer.parseInt(str.substring( 6, 11).trim()), - Integer.parseInt(str.substring(25, 37).trim())/2, - Integer.parseInt(str.substring(12, 24).trim()), - Integer.parseInt(str.substring(25, 37).trim()), - str.substring(38).trim(), - false); - - partition_map.add(partition); - str = in.readLine(); - } - } catch (IOException io) { - System.err.println( - "PartitionManager: error reading partition file [" - + filename - + "]"); - System.err.println(io); - } - } - - /** - * Find a partition with the specified name. - * @param name The name to search for. - * @return The partition found, or null if no such partition. - */ - public Partition getPartition(String name) { - Partition partition = null; - for (Enumeration e = partition_map.elements(); e.hasMoreElements();) { - partition = (Partition) e.nextElement(); - if (partition.getName().equals(name)) { - return partition; - } - } - return null; - } - - /** - * Finds the partition that matches the given extent, if any. - * @param extent The extent to compare to. - * @return The first matching partition, or null if none. - */ - public Partition getPartition(Extent extent) { - Partition partition = null; - for (Enumeration e = partition_map.elements(); e.hasMoreElements();) { - partition = (Partition) e.nextElement(); - if (partition.matchesExtent(extent)) { - return partition; - } - } - return null; - } - - /** - * Find the ith partition in the partition list. - * @param i Index number. - * @return The partition, or null if out of range. - */ - public Partition getPartition(int i) { - if ( i >= partition_map.size() ) { - return null; - } - return (Partition) partition_map.elementAt( i ); - } - - /** - * Adds the given partition as a XenoPartition. - * @param p The partition to add. - */ - void addXenoPartition(Partition p) { - for (Enumeration e = partition_map.elements(); e.hasMoreElements();) { - Partition partition = (Partition) e.nextElement(); - if (partition.identical(p)) { - partition.makeXeno(); - } - } - } - - /** - * Dump the XenoPartition list as XML. - * @param out Writer to dump to. - */ - void dumpAsXML(PrintWriter out) { - out.println(""); - for (Enumeration e = partition_map.elements(); e.hasMoreElements();) { - Partition partition = (Partition) e.nextElement(); - if (partition.isXeno()) { - partition.dumpAsXML(out); - } - } - - out.println(""); - - return; - } - - /** - * @return The number of partitions. - */ - public int getPartitionCount() { - return partition_map.size(); - } - - /** - * Get an iterator over all the partitions. - * @return An iterator over Partition objects. - */ - public Iterator iterator() { - return partition_map.iterator(); - } -} diff --git a/tools/control/src/org/xenoserver/control/Settings.java b/tools/control/src/org/xenoserver/control/Settings.java deleted file mode 100644 index 6f8d97c99f..0000000000 --- a/tools/control/src/org/xenoserver/control/Settings.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.xenoserver.control; - -import java.io.File; -import java.util.StringTokenizer; - -/** - * The Settings class is a repository for global settings such as the IP of - * the machine and the location of the defaults file. - */ -public final class Settings { - /** Filename for the defaults file. */ - public static final String DEFAULTS_FILE = - System.getProperty("DEFAULTS_FILE", "xenctl.xml"); - /** Path to search for the defaults file. */ - public static final String DEFAULTS_PATH = - System.getProperty("DEFAULTS_PATH", ".:/etc:/var/lib/xen"); - /** If set, do not call any xi_ commands, just print their command lines. */ - public static final boolean TEST = (System.getProperty("TEST") != null); - /** Name of xi_helper utility. */ - public static final String XI_HELPER = - System.getProperty("XI_HELPER", "xi_helper"); - /** File to parse to get partition info. */ - public static final String PARTITIONS_FILE = - System.getProperty("PARTITIONS_FILE", "/proc/xeno/blkdev_info"); - /** File to load virtual disk state from. */ - public static final String STATE_INPUT_FILE = - System.getProperty("STATE_INPUT_FILE", "/var/lib/xen/vdstate.xml"); - /** File to save virtual disk state to. */ - public static final String STATE_OUTPUT_FILE = - System.getProperty("STATE_OUTPUT_FILE", "/var/lib/xen/vdstate.xml"); - /** Size of a sector in bytes. */ - public static final int SECTOR_SIZE = - Integer.parseInt(System.getProperty("SECTOR_SIZE", "512")); - - /** - * Search for the defaults file in the path configured in DEFAULTS_PATH. - * @return Reference to the defaults file. - */ - public static File getDefaultsFile() { - StringTokenizer tok = new StringTokenizer(DEFAULTS_PATH, ":"); - File result = null; - File probe; - - while (tok.hasMoreTokens()) { - String probe_dir = tok.nextToken(); - probe = new File(probe_dir, DEFAULTS_FILE); - if (probe.exists()) { - result = probe; - break; - } - } - - if (result == null) { - System.err.println( - "Could not find " - + DEFAULTS_FILE - + " in path " - + DEFAULTS_PATH); - } - - return result; - } -} diff --git a/tools/control/src/org/xenoserver/control/StringPattern.java b/tools/control/src/org/xenoserver/control/StringPattern.java deleted file mode 100644 index 664bff0013..0000000000 --- a/tools/control/src/org/xenoserver/control/StringPattern.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.xenoserver.control; - -/** - * This utility class expands configuration file patterns. - */ -public class StringPattern { - /** The base string for this pattern. */ - private String base; - /** The base number for this pattern. */ - private int bn; - /** If true, add the domain number to the base number and append. */ - private boolean addDom; - /** If true, append the domain number to the base string. */ - private boolean appendDom; - - /** - * Parse a string into a pattern. - * @param t The pattern string to parse. - * @return A usable pattern object. - */ - public static StringPattern parse(String t) { - StringPattern result = new StringPattern(); - char[] ca = t.toCharArray(); - int idx = 0; - int len = ca.length; - - if (len == 0) { - result.base = ""; - result.bn = 0; - result.addDom = false; - } else if (ca[len - 1] == '+') { - idx = len - 2; - if ((idx >= 0) && (ca[idx] >= '0') && (ca[idx] <= '9')) { - while ((idx >= 0) && (ca[idx] >= '0') && (ca[idx] <= '9')) { - idx--; - } - result.base = t.substring(0, idx + 1); - result.bn = Integer.parseInt(t.substring(idx + 1, len - 1)); - result.addDom = true; - } else { - result.base = t.substring(0, len - 1); - result.appendDom = true; - } - } else { - result.base = t; - } - - return result; - } - - /** - * Resolve the pattern for the given domain number. - * @param domain The domain number to use. - * @return The expanded pattern for the given domain. - */ - public String resolve(int domain) { - if (addDom) { - return base + (bn + domain); - } else if (appendDom) { - return base + domain; - } else { - return base; - } - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return ( - "[" - + base - + (addDom ? "+" + bn : "") - + ((addDom || appendDom) ? "+ID" : "") - + "]"); - } - -} diff --git a/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java b/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java deleted file mode 100644 index 2b1a5ceb21..0000000000 --- a/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * VirtualBlockDevice.java - * 03.03.27 aho creation - */ - -package org.xenoserver.control; - -/** - * A virtual block device; a mapping from a domain-specific number to a virtual - * disk with associated access mode. - */ -public class VirtualBlockDevice { - /** The virtual disk which this block device maps onto. */ - private VirtualDisk vd; - /** The domain in which this block device exists. */ - private int domain; - /** The block device number in that domain. */ - private int vbdNum; - /** The access mode within that domain. */ - private Mode mode; - - /** - * Constructor for VirtualBlockDevice. - * @param vd The virtual disk to map to. - * @param domain The domain to create the device in. - * @param vbdNum The number for the device. - * @param mode The access mode. - */ - VirtualBlockDevice( - VirtualDisk vd, - int domain, - int vbdNum, - Mode mode) { - this.vd = vd; - this.domain = domain; - this.vbdNum = vbdNum; - this.mode = mode; - } - - /** - * @return This device's virtual disk. - */ - public VirtualDisk getVirtualDisk() { - return vd; - } - - /** - * @return The domain this device exists in. - */ - public int getDomain() { - return domain; - } - - /** - * @return The device number within its domain. - */ - public int getVbdNum() { - return vbdNum; - } - - /** - * @return This device's access mode. - */ - public Mode getMode() { - return mode; - } -} diff --git a/tools/control/src/org/xenoserver/control/VirtualDisk.java b/tools/control/src/org/xenoserver/control/VirtualDisk.java deleted file mode 100644 index 6d4fde90ab..0000000000 --- a/tools/control/src/org/xenoserver/control/VirtualDisk.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * VirtualDisk.java - * 03.03.26 aho creation - */ - -package org.xenoserver.control; - -import java.io.PrintWriter; -import java.util.Date; -import java.util.Iterator; -import java.util.Vector; - -/** - * A single virtual disk. This may be used by multiple virtual block devices. - */ -public class VirtualDisk { - /** The name of this virtual disk. */ - private String name; - /** The key of this virtual disk (unique). */ - private String key; - /** The expiry time of this virtual disk, or null for never. */ - private Date expiry; - /** The extent list for this virtual disk. */ - private Vector extents; - - /** - * Construct a new virtual disk, specifying all parameters. - * @param name Name of the new disk. - * @param expiry Expiry time, or null for never. - * @param key Key for the new disk, or null to autogenerate. - */ - VirtualDisk(String name, Date expiry, String key) { - this.name = name; - if (key == null) { - this.key = generateKey(); - } else { - this.key = key; - } - this.expiry = expiry; - extents = new Vector(); - } - - /** - * Construct a new virtual disk, with automatically generated key and no expiry. - * @param name Name of the new disk. - */ - VirtualDisk(String name) { - this(name, null, null); - } - - /** - * Construct a new virtual disk, with automatically generated key. - * @param name Name of the new disk. - * @param expiry Expiry time, or null for never. - */ - VirtualDisk(String name, Date expiry) { - this(name, expiry, null); - } - - /** - * Generate a unique key for this virtual disk. - * For now, just generate a 10 digit number. - * @return A unique key. - */ - private static String generateKey() { - return Long.toString( - 1000000000L + (long) (Math.random() * 8999999999L)); - } - - /** - * Add an extent to this disk. - * @param extent The extent to add. - */ - void addExtent(Extent extent) { - extents.add(extent); - } - - /** - * Remove the first extent from this disk. - * @return The extent removed, or null if there are no extents. - */ - Extent removeExtent() { - Extent e; - - if (extents.size() > 0) { - e = (Extent) extents.remove(0); - } else { - e = null; - } - - return e; - } - - /** - * Form a string suitable for passing into the XenoLinux proc interface mapping - * the given VBD to this virtual disk. - * @param vbd The virtual block device to map. - * @return A XenoLinux /proc string. - */ - String dumpForXen(VirtualBlockDevice vbd) { - StringBuffer sb = new StringBuffer(); - - sb.append( - "domain:" - + vbd.getDomain() - + " " - + vbd.getMode().toString() - + " " - + "segment:" - + vbd.getVbdNum() - + " " - + "key: " - + this.getKey() - + " " - + "extents:" - + extents.size() - + " "); - for (int loop = 0; loop < extents.size(); loop++) { - Extent e = (Extent) extents.get(loop); - sb.append( - "(disk:" - + e.getDisk() - + " " - + "offset:" - + e.getOffset() - + " " - + "size:" - + e.getSize() - + ")"); - } - return sb.toString(); - } - - /** - * Dump the virtual disk as XML. - * @param out The writer to dump to. - */ - void dumpAsXML(PrintWriter out) { - out.println(" "); - out.println(" " + name + ""); - out.println(" " + key + ""); - if (expiry == null) { - out.println(" 0"); - } else { - out.println(" " + expiry.getTime() + ""); - } - out.println(" "); - for (int loop = 0; loop < extents.size(); loop++) { - Extent e = (Extent) extents.get(loop); - out.println(" "); - out.println(" " + e.getDisk() + ""); - out.println(" " + e.getSize() + ""); - out.println(" " + e.getOffset() + ""); - out.println(" "); - } - out.println(" "); - out.println(" "); - - return; - } - - /** - * Add a partition as a XenoPartition. - * Chop the partition in to extents and add them to this virtual disk. - * @param partition The partition to add. - * @param extentSize The number of sectors to use for each extent. - */ - void addPartition(Partition partition, long extentSize) { - int loop; - - for (loop = 0; loop < partition.getNumSects() / extentSize; loop++) { - Extent extent = - new Extent( - partition.getDisk(), - partition.getStartSect() + (extentSize * loop), - extentSize); - - addExtent(extent); - } - } - - /** - * @return The name of this virtual disk. - */ - public String getName() { - return name; - } - - /** - * @return The key of this virtual disk. - */ - public String getKey() { - return key; - } - - /** - * @return The expiry time of this virtual disk. - */ - public Date getExpiry() { - return expiry; - } - - /** - * @return The number of extents in this virtual disk. - */ - public int getExtentCount() { - return extents.size(); - } - - /** - * @return Total size of this virtual disk in sectors. - */ - public long getSize() { - long size = 0; - Iterator i = extents.iterator(); - while (i.hasNext()) { - size += ((Extent) i.next()).getSize(); - } - return size; - } - - /** - * @return An iterator over all extents in the disk. - */ - public Iterator extents() { - return extents.iterator(); - } - - /** - * Reset the expiry time for this virtual disk. - * @param expiry The new expiry time, or null for never. - */ - void refreshExpiry(Date expiry) { - this.expiry = expiry; - } -} diff --git a/tools/control/src/org/xenoserver/control/VirtualDiskManager.java b/tools/control/src/org/xenoserver/control/VirtualDiskManager.java deleted file mode 100644 index 8ff9041e8c..0000000000 --- a/tools/control/src/org/xenoserver/control/VirtualDiskManager.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * VirtualDiskManager.java - * 03.03.26 aho creation - */ - -package org.xenoserver.control; - -import java.io.PrintWriter; -import java.util.Date; -import java.util.Iterator; -import java.util.LinkedHashMap; - -/** - * VirtualDiskManager manages the list of virtual disks on the machine. It is - * a Singleton which automatically initialises itself on first class reference. - */ -public class VirtualDiskManager { - /** The single VDM reference. */ - public static final VirtualDiskManager IT = new VirtualDiskManager(); - /** The free-space disk. */ - private VirtualDisk freeDisk; - /** The map of keys to virtual disks. */ - private LinkedHashMap virtualDisks = new LinkedHashMap(100); - - /** - * VDM constructor, private as it's a singleton. - */ - private VirtualDiskManager() { - freeDisk = new VirtualDisk("free"); - } - - /** - * Get the virtual disk with the specified key. - * @param key The key to look for. - * @return The virtual disk, or null if not found. - */ - public VirtualDisk getVirtualDisk(String key) { - return ((VirtualDisk) virtualDisks.get(key)); - } - - /** - * Add a new partition to the free space list in the disk manager. - * @param partition The partition to add. - * @param chunkSize The chunk size to split the partition into, in sectors. - */ - void addPartition(Partition partition, long chunkSize) { - freeDisk.addPartition(partition, chunkSize); - } - - /** - * Create a new virtual disk. - * @param name The disk name to use. - * @param size The number of sectors to allocate. - * @param expiry The expiry time, or null for never. - * @return null if not enough space is available - */ - VirtualDisk createVirtualDisk(String name, long size, Date expiry) { - if (freeDisk.getSize() < size) { - return null; - } - - VirtualDisk vd = new VirtualDisk(name, expiry); - - while (size > 0) { - Extent e; - - e = freeDisk.removeExtent(); - if (e == null) { - return null; - } - size -= e.getSize(); - vd.addExtent(e); - } - - insertVirtualDisk(vd); - - return vd; - } - - /** - * Delete a virtual disk, and put its extents back into the free pool. - * @param key The key of the disk to delete. - */ - void deleteVirtualDisk(String key) { - VirtualDisk vd; - - vd = (VirtualDisk) virtualDisks.get(key); - if (vd != null) { - Extent e; - - virtualDisks.remove(key); - - e = vd.removeExtent(); - while (e != null) { - freeDisk.addExtent(e); - e = vd.removeExtent(); - } - } - } - - /** - * Insert a new virtual disk into the map. - * @param vd The disk to insert. - */ - void insertVirtualDisk(VirtualDisk vd) { - virtualDisks.put(vd.getKey(), vd); - } - - /** - * Hash a virtual block device. - * @param domain The VBD's domain. - * @param vbdNum The VBD's number within the domain. - * @return A suitable hash key. - */ - Object hashVBD(int domain, int vbdNum) { - return new Integer(domain * 16 + vbdNum); - } - - /** - * Set a new free disk. - * @param vd The free disk to set. - */ - void setFreeDisk(VirtualDisk vd) { - freeDisk = vd; - } - - /** - * Dump the data in the VirtualDiskManager in XML form. - * @param out The output writer to dump to. - */ - void dumpAsXML(PrintWriter out) { - out.println(""); - freeDisk.dumpAsXML(out); - out.println(""); - out.println(""); - Iterator i = virtualDisks.values().iterator(); - while (i.hasNext()) { - VirtualDisk vd = (VirtualDisk) i.next(); - vd.dumpAsXML(out); - } - out.println(""); - } - - /** - * @return The free disk. - */ - public VirtualDisk getFreeDisk() { - return freeDisk; - } - - /** - * @return An iterator over the virtual disks. - */ - public Iterator getVirtualDisks() { - return virtualDisks.values().iterator(); - } -} diff --git a/tools/control/src/org/xenoserver/control/XML.java b/tools/control/src/org/xenoserver/control/XML.java deleted file mode 100644 index 3988d8407c..0000000000 --- a/tools/control/src/org/xenoserver/control/XML.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * XML.java - * 03.03.26 aho creation - */ - -package org.xenoserver.control; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -/** - * Utility class for loading and saving state through XML files. - */ -public class XML { - /** The document we are reading/writing. */ - private static Document document = null; - - /** - * Save the state of the managers to the configuration file given. - * @param pm The PartitionManager to save. - * @param vdm The VirtualDiskManager to save. - * @param filename The configuration filename to save to. - */ - public static void saveState( - PartitionManager pm, - VirtualDiskManager vdm, - String filename) { - PrintWriter out; - - try { - out = new PrintWriter(new BufferedWriter(new FileWriter(filename))); - } catch (IOException e) { - System.err.println("XML.dump_state error [" + filename + "]"); - System.err.println(e); - return; - } - - out.println(""); - out.println(""); - pm.dumpAsXML(out); - vdm.dumpAsXML(out); - out.println(""); - - out.close(); - return; - } - - /** - * Load the state of the managers from the given configuration file. - * @param pm The PartitionManager to load. - * @param vdm The VirtualDomainManager to load. - * @param filename The filename to read the configuration from. - */ - public static void loadState( - PartitionManager pm, - VirtualDiskManager vdm, - String filename) { - if (document == null) { - loadFile(filename); - } - - XMLHelper.parse(pm, vdm, document); - } - - /** - * Load an XML file and parse it into a Document. - * @param filename The file to load. - */ - private static void loadFile(String filename) { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - - try { - File file = new File(filename); - - DocumentBuilder builder = factory.newDocumentBuilder(); - document = builder.parse(file); - } catch (SAXParseException spe) /* error generated by parser */ { - System.err.println( - "xml parser exception on line " - + spe.getLineNumber() - + " for uri " - + spe.getSystemId()); - System.err.println(spe.getMessage()); - - Exception x = spe; - if (spe.getException() != null) { - x = spe.getException(); - } - x.printStackTrace(); - System.exit(1); - } catch (SAXException sxe) { - Exception e = sxe; - if (sxe.getException() != null) { - e = sxe.getException(); - } - e.printStackTrace(); - System.exit(1); - } catch (ParserConfigurationException pce) { - pce.printStackTrace(); - } catch (FileNotFoundException fnfe) { - System.err.println( - "warning: state file not found [" + filename + "]"); - } catch (IOException ioe) { - ioe.printStackTrace(); - } - return; - } -} diff --git a/tools/control/src/org/xenoserver/control/XMLHelper.java b/tools/control/src/org/xenoserver/control/XMLHelper.java deleted file mode 100644 index abdfe924ca..0000000000 --- a/tools/control/src/org/xenoserver/control/XMLHelper.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * XMLHelper.java - * 03.03.27 aho creation - */ - -package org.xenoserver.control; - -import java.util.Date; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * XMLHelper contains helper methods used to parse the XML state files. - */ -class XMLHelper { - /** - * Find a subnode with the specified name. - * @param name Name to look for. - * @param node Node from which to start search. - * @return The first subnode found, or null if none. - */ - private static Node getSubNode(String name, Node node) { - if (node.getNodeType() != Node.ELEMENT_NODE) { - System.err.println("Error: Search node not of element type"); - return null; - } - - if (!node.hasChildNodes()) { - return null; - } - - NodeList list = node.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - Node subnode = list.item(i); - if (subnode.getNodeType() == Node.ELEMENT_NODE) { - if (subnode.getNodeName() == name) { - return subnode; - } - } - } - return null; - } - - /** - * Get all the text of a given node. - * @param node The node to examine. - * @return The node's text. - */ - private static String getText(Node node) { - StringBuffer result = new StringBuffer(); - if (node == null || !node.hasChildNodes()) { - return ""; - } - - NodeList list = node.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - Node subnode = list.item(i); - if (subnode.getNodeType() == Node.TEXT_NODE) { - result.append(subnode.getNodeValue()); - } - } - return result.toString(); - } - - /** - * Parse the given configuration document and configure the managers. - * @param pm PartitionManager instance to configure. - * @param vdm VirtualDomainManager instance to configure. - * @param document Document to parse. - */ - static void parse( - PartitionManager pm, - VirtualDiskManager vdm, - Document document) { - if (document == null) { - return; - } - - /* parse partitions */ - parsePartitions(pm, document.getElementsByTagName("partition")); - - /* parse virtual disks */ - NodeList list = document.getElementsByTagName("virtual_disk"); - for (int i = 0; i < list.getLength(); i++) { - Node subnode = list.item(i); - String parent = subnode.getParentNode().getNodeName(); - VirtualDisk vd = parseVirtualDisk(subnode); - - if (parent.equals("free")) { - vdm.setFreeDisk(vd); - } else if (parent.equals("virtual_disks")) { - vdm.insertVirtualDisk(vd); - } else { - System.out.println( - "XML parse error: unknown parent for virtual_disk " - + "[" - + parent - + "]"); - } - } - } - - /** - * Parse a node representing a virtual disk. - * @param node The node to parse. - * @return The VirtualDisk this node represents. - */ - private static VirtualDisk parseVirtualDisk(Node node) { - VirtualDisk vd; - Date date = new Date(); - NodeList list; - - long timestamp = - Long.parseLong( - XMLHelper.getText(XMLHelper.getSubNode("expiry", node))); - if (timestamp == 0) { - date = null; - } else { - date.setTime(timestamp); - } - vd = - new VirtualDisk( - XMLHelper.getText(XMLHelper.getSubNode("name", node)), - date, - XMLHelper.getText(XMLHelper.getSubNode("key", node))); - - list = XMLHelper.getSubNode("extents", node).getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - Node enode = list.item(i); - - if (enode.getNodeType() == Node.ELEMENT_NODE - && enode.getNodeName().equals("extent")) { - Extent extent = - new Extent( - Integer.parseInt( - XMLHelper.getText( - XMLHelper.getSubNode("disk", enode))), - Long.parseLong( - XMLHelper.getText( - XMLHelper.getSubNode("offset", enode))), - Long.parseLong( - XMLHelper.getText( - XMLHelper.getSubNode("size", enode)))); - - vd.addExtent(extent); - } - } - - return vd; - } - - /** - * Parse a list of partition nodes. - * @param pm The partition manager to configure. - * @param nl The list of partition nodes. - */ - private static void parsePartitions(PartitionManager pm, NodeList nl) { - Partition partition; - - for (int loop = 0; loop < nl.getLength(); loop++) { - Node node = nl.item(loop); - - partition = - new Partition( - Integer.parseInt( - XMLHelper.getText(XMLHelper.getSubNode("major", node))), - Integer.parseInt( - XMLHelper.getText(XMLHelper.getSubNode("minor", node))), - Integer.parseInt( - XMLHelper.getText( - XMLHelper.getSubNode("blocks", node))), - Integer.parseInt( - XMLHelper.getText( - XMLHelper.getSubNode("start_sect", node))), - Integer.parseInt( - XMLHelper.getText( - XMLHelper.getSubNode("nr_sects", node))), - XMLHelper.getText(XMLHelper.getSubNode("name", node)), - true); - - pm.addXenoPartition(partition); - } - } -} diff --git a/tools/control/src/org/xenoserver/web/RootBean.java b/tools/control/src/org/xenoserver/web/RootBean.java deleted file mode 100644 index 858ee9e3ad..0000000000 --- a/tools/control/src/org/xenoserver/web/RootBean.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * RootBean.java - * 03.05.05 aho creation - */ - -package org.xenoserver.web; - -import javax.servlet.http.HttpSessionBindingEvent; -import javax.servlet.http.HttpSessionBindingListener; - -import org.xenoserver.control.PartitionManager; -import org.xenoserver.control.Settings; -import org.xenoserver.control.VirtualDiskManager; -import org.xenoserver.control.XML; - -public class RootBean implements HttpSessionBindingListener { - PartitionManager pm; - VirtualDiskManager vdm; - - public RootBean() { - valueBound(null); - } - - public void valueBound(HttpSessionBindingEvent event) { - pm = PartitionManager.IT; - vdm = VirtualDiskManager.IT; - XML.loadState(pm, vdm, Settings.STATE_INPUT_FILE); - } - - public void valueUnbound(HttpSessionBindingEvent event) { - doFlushState(); - } - - public PartitionManager pm() { - return pm; - } - - public VirtualDiskManager vdm() { - return vdm; - } - - public void doFlushState() { - XML.saveState(pm, vdm, Settings.STATE_OUTPUT_FILE); - } -} diff --git a/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java b/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java deleted file mode 100644 index 1b67152895..0000000000 --- a/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * SystemConfigurationBean.java - * 03.05.06 aho creation - */ - -package org.xenoserver.web; - -import org.xenoserver.control.Defaults; - -public class SystemConfigurationBean { - private Defaults defaults; - - public SystemConfigurationBean() { - defaults = new Defaults(); - } - - public Defaults getDefaults() { - return defaults; - } -} diff --git a/tools/control/web/WEB-INF/web.xml b/tools/control/web/WEB-INF/web.xml deleted file mode 100644 index c1e0d41784..0000000000 --- a/tools/control/web/WEB-INF/web.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Xen Control - - Copyright 2003, University of Cambridge Computer Laboratory - This is version 1.0-beta of the Xen control software. - - - index.jsp - - - - 30 - - - diff --git a/tools/control/web/img/cambridge.gif b/tools/control/web/img/cambridge.gif deleted file mode 100644 index f30964c143c4e88cd9c871256bfbd820661b25dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1733 zcmV;$20HmiNk%w1VZZ<`0J8u900030|NpVE0J#VV%*@PdV_TV-nKLsp{s96200000 z00000000000000000000A^8LZ6afDKEC2ui0Kfn)000F4Fvv-(y*TU5yZ>M)j$~<` zXsWJk>%MR-&vb3yc&_h!@Bb-)a7Zi~kHU(9XqYU8h9{s!avS~dw zmBa(V0G)Q8Zed%?9 zSSWVN;@vq^P0oOClLENv^-zEuM-T^ytM%`WIXcJxJZ;?NF(jW<3NZRZ&RH)rBb*sr8{IU;r*J2MjCd?~c)vn;ov}6_blYrTbEMD5z3sF8O>YqtS|#m(QnbbQ6wlbO--Xpw1X$KJw*nq+OfPUSS`?p z8JIpbU$=~jSVK>+n%g2XJm`<|0Hl}xC7MW^CPmT#PzM}VYHYfCq-?XD`BRgdU43#5 zoJXsYHa68_-hdke@n|}n3uL(Dk|CObskvqsf~Xnd zPub|DO%&i5@J$n>kOG~3gAfv4b44zpO>>-`q(rEN)C3YDq*&DxZv-iZNMfj7=t&zk zW}w(b>z!Ihk)MX*sZxwQ(u9CverlZmt{gy%fwU_40)&Xva&U<&R%{hTB9A16%cV#i zcI~<7Zg5F2+sqNg8r>*s#TrqxYi_#u=Ig9Pm!8^41_pG=_24H*pVXe z8F?a8Z?@V{Y_JQzylb%r(m3Mr$J9vh-^V0hVcc(yv=Xc!eV*E!w6@Bz6{~;DkxHUN z6ygY2wu;(Js6_yxLCh&{<_{7UCW##*1S+yd#&Yr|33d^82i9>CR+hmjoWVm#)}2Uk z^_VX88kSGO3W>+S$$3_WkWZ+&#E1`B<4sWusU}@fM49|(*SsNjO3Ph!Nz-lr{ML3_ zXww*wqj6si2C;9b-3oHODhaaxAE;eNon4gVbynk>I9jxPg}2Px*U1^1G(vB#bhLMu zzliqaTU&0pE_5@M$TfOdYv4DfxwcbF_F?{N?!O5x$LmoszW6J$J6@Qhg|!v=&^Onv z!S8-ygpH?rR}+ry8=qPs@;lk;nIqd%77E$0r+pUfyR$dZWx015AsVH@i<7(+rSM7O zHQ3vbCaf~8RVeOFUKj#$GU1CJ6$y9j@eFaW_M(?C@BP#>zu-tw{r)trba2Si}{ z_<)}xlId)cfeiiFqX}aFpyfBABGv|fc)0Ue(Ktj3hRgu9M7-%@FVh&xBE*1!=6&FZ zNE}BO4F!uEO2vgWDj?sBYbp(_`0BMADrQ=`4PIbH%x{eT}{9;Gq zrzb5T2bBpVo7f(uy99EqX>Ul;Bo#rpGB!{$eFWk-m=Q+#wa%OM^P=1YL&n*Gb9CLy zUlV;5%W=IyDbzF@J5w3BLtW?;V`By}b#zWI`UZKnItVh4DVR_mt(g~E*_ucPp%7g1 zalR0PuJXtdW=v*sl<9<&KXdsUQ`UoZ3{nP=expwbGN>29D8t6YAh0}8E?TS8VIOQ3 z(>2a44OU>)s8SJAqxDpWw@L`j=8?0W!76)4u-VD*c&k}36{jG0!b?RE3>l>FVq2>! bR=3L4u6p&WU=6ES$4b_+n)R$;jQ{{UpNu1x diff --git a/tools/control/web/img/help.gif b/tools/control/web/img/help.gif deleted file mode 100644 index e7d480939bd51b9d0ea7cb2d540ab8c03e46cf6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 243 zcmZ?wbhEHbG-VKC*vtR~##5%O{{R2KgG1VxGiMGQIGd2rprGLUkC6!^i2)RUvapCS z{AbVs$$-pYU|A5*;JJFQMYhiN{|m0x9%hhBtLU8<(7?LdZ_~3wTW1x!C5Z9 zdX~cE=$2hoS|D8~YF@%_&ukdk8k6Rcq-%-jGUF91h1t`V duiNa;vTgg0ox67L*}L0*-@!wNcM39C0|3KbT+jdj diff --git a/tools/control/web/img/home.gif b/tools/control/web/img/home.gif deleted file mode 100644 index 9c07803d3b391aa1c5712480ccfa6c86aeccecfa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 244 zcmZ?wbhEHbG-VKC*v!DdF!Kx$IBdT8|Ns95H{TQ-dt|WY+JR@E{xLEEB{6~GPZkyt zhW`vYASsX;3@i%^8a!9;waC`l{(r&M#3sRc_bYhWU!|?OvCl*_T*r{-P|6GDrjrF4 zZ}^&&Sv@}7$!T`lw0ZJ7hG513X;z7~#xvSXEj{*4&fm22SXnvKI!~V2GxzTCycAXN z{X2toQ)P)vS$b?mOGB_l*nyy~8W}Vsk fjT<&?WML9}ASWA-Tv z4FqHunw|5Ko^X~Zc^gjPVXA1>{1jOu+8Yuc)Nra+f7M!r1}2Fkp{E`^TN-=v-L}F* z&hc~H*y1fLvTRE2$}{x40)v`ta)1YWsaCz zlQ~`7+*a6mn}-*xP1EElUj9DwHf=IGzTm_u-P31{&z)mpxqRj7wd*%--nwz=_PzTL Jt_d<&0|3rJY>5B> diff --git a/tools/control/web/img/xeno.gif b/tools/control/web/img/xeno.gif deleted file mode 100644 index efd7d0ad9ff835de606367f635fa874c895df32d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3600 zcmWkwdpMJe1K!Or%VjsiFqgzy!jaI*#*SvKVxeetTsF6;xtusE*(^h=aD*toxr9)M zbfHvoOOmKns;>_9mFj$Tocb#D``Y>Sd;fUVcB|@Ie)PsZ+;d1A!bQE(W$HA>Sa7NCa7I znB@j!q{9CGAdLyuRRUrW63hqsI*<%GA`XWi>ww%;9gPCE9ft$`p}17|BLsMPAQ&97 zFIQ({jocbShOYr}5(IpV=x!mZeB@|3v~C0Z9&9o&Mmk!N%Uys-2%6HMrEWlUxWt+P zsd6AP8O}_HBQ_xv8q!#Uq$UE+j>y){hzS9yt%5WvV5uAO{TssJK$p(~3_Bo2+C(4% z=4R0EM-XQwa;_6bV0ce1;O~nZDuNld$g<_g(}&2X_d1~n9=?)=CuUhQ#$BBufA8^V z3Ak@R)Z76%+3UQQLkt`6a1j{D1$QTb@lsF{J?_rd1qDEOBRF0H{$8rvor*lUg?M?x zk|^Zu6CKAJG9f?|22^(p6pNsadRQuh*NG75RR;zK3Plis0;VN{s=W}O4|#h-yZ1to z5}3w-3so?l0{>_{HC6Y6C&pn@3f$fS9M-^B`+#5(l8_3rykU25n8ODzb-+PY4zSH*~cR)+2D93RuHON-Cf= ze4P&mvU3JAv%u|ASjY!+vj7@>?+*_TbmMjmsQEbj3V?#WK^g_Ra0c3)g?t8~$S{~j zfeUkBJPxib(?y2E&05&S8J-w|eY{{(B3xGmUp=RDcSRDUupI@_L!i4W?9PVQaDd2g zBxZP$jJY;seJF~J`howC1ZAX0 zUDH?}I55+%#FHH*Ii2-^YNEYRBd}-~F1B162efv@j~rnH#95tMU+V1gZ?%V?T5t@vT`){2xT%?x7CAG3o8 z{?xy_95;H|bTzH9BK6bpF>3ilum8nU9?$RO47#5OE-FsgVCgDFO|vaF@5K4%IbIWY zPS}v2pGMu@lP0;S9C`jd`^?B8xi8|?g=)WZ$S3bZXx+DsYWu{r$3-Pz@5StM4PW)o z&L5u*K7VblR8+6Na!AF$*BDLv2z+IaSMqs4-?8Br(V zMapUO)<0E}H;YG;3a>bp;O?usLa2GpuQj-~q00MqMi;u62iPgY|6%?+WJwp+!?SDc zHv*G&xVPLH!e;I3X&!bNtv4d4>H7`J(gb27jv1{jz^~XI+bObv`YjsEB*IUQl7&wP zie1womlqK~5Su*_3h)X`}jjVjjvP&ncwts(_lBBo%rrz8N zd5pGc+{)5#|0J89{cDv2v#TbgLFmXe>?TTglM zf?dO%U$k2@Tg_dfmsh6H@u7V!sn+kOJ53#%HVpHqV!&mLB6d|gT_nzWts`(|_NWcX z<6-wbzdoD7Gc!B<=joxU1;BQ~H#5k-CBOSVCl{>M4rU8@W4(z{MYFMS3;%><&`Wtd z>PAWW;O%`mj+=#ZT8E!)vY~DvmfmysFf9%FZ!lIGgE?^6_?daJ=7Z+<8D9hbu#lDq zpadjFX}U30ECoi$W$YE(%B$g7xl(>{N=?qZGQI7W*rfCz{gQRn_tpZB{O%R2Tw_TM zfbmS?AX#q6HD#J{o^H3P7)_EW8;Vd=N52c`;347nMiYv0!r24oHm2Pj%4~pw#y!+a z7HuuH-6h}>rUYlaVV1x5%8;p`ZbNV5 zfkCxLtB>$6(NrDfYG>|-rP*-UBFCjYXKyamPFp;;#Y*4SZc<(7J!2XzkQ@1*%g0da zPzF|6N=#Ro3A^qEF-*f{)e3@bI5U2;#~TT-VDe4#S;N<|7Nd=RYrVJJC~WnX5hn*t zS8=PV_Kyyl?J_Djrw=>4tF)irdvKHZm9DB%bIME~;1Q<5IZ;{8Nf=y@4f%6up<9+x zu<^}+2MNUDL^6ZxqlaB5`Y9FjJdBlz+SxhCI%L{`mseySuD@O&LJh=+TRCpKigW7@ zZ!;#L_^SmUZR~;2;rKjO^&8;C+uf z&3s)G4MxllESIaRLuO?L>*uk|o*wG0n1(fCbDnLzQZ@J#W$zlVwAKa{IH%7fruCqm zCMxhT33C=(&k_l?T;ItomTx!vmNUZD7-kH6y&R3(t>ujc=m)8f`v%c9R?9{lZn)96 z#3=FUN8@m37X7EQL9B5=C-6VIH|slUg;}M=Hu7%vPVS^_QfzyR`Ku#yM$&H_tD~C* zGx#QM1g*j4RvXf2U&~euh%+!@Dy+J%YwOCb!Px<82=*H?)hn9@Y=iyO2GZ%_ z6>UwncBxqR%Z-M)ssfV@ero4t)JlsiGPR3rumlxf=!1)C$_YEx@gT#LUo>F0OmJ#% z^4bUP_x zPos7(9yhaJeedy18n^#pn!EZNjWjN&i zmAyT@wVy2`?~?}`B0G*&Xt6sDQGZ0pYnakFt*m17y~At*<~Q+4(_?~3Q%PC5nAvI_ zx4|(z-`wn9zeK!|E057(pWveqSSpAZ<_D-t@G!vtx{qw98}O=UP2Kv z?KUL$>nZP<1vhi&j^$;YK6>`!*@}_YoDIzrUsHcV8~u2MpZ*E*QOU7TjrrnOW{Q${ zeQS%zk!L2jyS?B|QKcwpR1wQv98mV~H2dY)qk3#a4)dW?j}_}u(YD3kwE5^;hVEMP zvXyjyDnD>7c`7hu(^{QTcAwRL55kAMyV|68Sq=CvooZ9}^h2IHu2EpMYIP*DI6whJzE#e8 zxb#F!PKGDFGj;bf+C`g%S#;{?E{0;;OQ1LZN&c;`YnTp}$y*$gCp>s91#KUEwqWR9 ztW2fqpT>41o=CZhG4LXXbMmK1?I$&>>?$&Q{89;@hUeZDeylIZUY)Wg$$t}6wuM(7 zv*O=QG*w)5GB-1;=YxBqhYV4B4t7ZdfT z#H#%rDDtUaIlv`$6;+ESypT_OC@nOUG!bLn>92%|DV+_f>O(qm!%i3ac$I1tTZvK> zXC$Lnhb};36n@+LbvyU9Nohe_M#wR9>R5q-zR?5E1e!gu^l-P&9)ozT-dy9xsmEG& z27*DOs&MY?BHz%ia7z8Y_uWDG9j}KM>Xqm57rQJFoz|(W&7gZu;+aX7PObKlGlpi<1%(#ayvgm$ z1^IEY&TgK@E9cPy-+b38!Ag|9uQNI#iDqa(^_etW%oWr;SCQ`7 zoZW1?DxQ%)ze`q4P3CUeV1d6W$F}67x3*G)M(HUthR3)juPkB=+B?yt8AEGxr7Xvk zF^?m882p`&;mmkv#~3@IihT?iG0$!NOC1w}czJTdNx3@F6W4`ZIVd+#6j6ufilcef zwERSc6S~U5M} z>B30+4S${4vG7Tgpg_|?4Nvv2>3Z$BJ}m$9Nydzkyw9`f9sS6@GIxsWk - - - - - - - - -
- - - - - - - - - - - - - -
-

-The XenoServer project aims to build a public infrastructure for wide-area distributed computing. -

-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
Overview
-The Xenoserver project is building a public infrastructure for wide-area distributed computing. We envisage a world in which Xenoserver execution platforms will be scattered across the globe and available for any member of the public to submit code for execution. Crucially, the sponsor of the code will be billed for all the resources used or reserved during the course of execution. This will serve to encourage load balancing, limit congestion, and hopefully even make the platform self-financing. -

-A global infrastructure such as we propose is essential to address the fundamental problem of communication latency. By enabling principles to run programs at points throughout the network they can ensure that their code executes close to the entities with which it needs to interact. As well as reducing latency this can be used to avoid network bottlenecks, to reduce long-haul network charges and to provide a platform over which code provided by transiently-connected mobile devices can maintain a network presence. -

-Our approach is distinguished from existing work on mobile agents, execution platforms, code hosting and the like by two principles: -

-Tackling difficult problems at the same time. Acceptable designs for execution environments, resource management, resource discovery, authentication, privacy, charging, billing, payment and auditing are all crucial to the success of our platform as an infrastructure service open to and accepted by the public. Existing work has tackled individual subsets of these problems, but tensions between the issues concerned mean that solutions proficient in some dimension are lacking in another. -

-No brave new world. Our platform will host applications written in today's programming languages against existing APIs -- and, we believe, those written with tomorrow's languages and libraries. We do not want to mandate a particular code distribution format or a particular middleware toolkit for distributed programming. -

- Project Overview Document
-
-
- diff --git a/tools/control/web/tmpl/dom-del.tmpl b/tools/control/web/tmpl/dom-del.tmpl deleted file mode 100644 index b6a9810c4e..0000000000 --- a/tools/control/web/tmpl/dom-del.tmpl +++ /dev/null @@ -1,96 +0,0 @@ -Delete Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- -
- - - - -<% - } -%> - -##WHITESPACE## ##GREYLINE1## ##WHITESPACE## - - - -##WHITESPACE## ##GREYLINE1## ##WHITESPACE## - - - - - -
-<% - CommandDomainList list = new CommandDomainList(sc.getDefaults()); - String output = list.executeWeb(); - Domain domains[] = list.domains(); - if (output != null) - { -%> -<%= output %> -<% - } else { -%> - - - - - <% - for (int loop = 0; loop < domains.length; loop++) - { - %> - - - - - - - - - - - <% - } - %> - - -
domain
id
processorhas
cpu
statemcu
advance
total
pages
name
<%= domains[loop].id %><%= domains[loop].processor %><%= domains[loop].cpu %> <%= domains[loop].state %> <%= domains[loop].mcu %> <%= domains[loop].pages %> <%= domains[loop].name %>
-
- - - - - - - - - - - - - - - - -
don't force
force
-
-
- -
- - - - - diff --git a/tools/control/web/tmpl/dom-delr.tmpl b/tools/control/web/tmpl/dom-delr.tmpl deleted file mode 100644 index 9dad9de69e..0000000000 --- a/tools/control/web/tmpl/dom-delr.tmpl +++ /dev/null @@ -1,50 +0,0 @@ -Delete Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- - -Delete Domain Results -
- -<% - HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); - Defaults d = sc.getDefaults(); - - String domains[] = hsrw.getParameterValues("dom"); - boolean force = hsrw.getParameter("force").equals("true"); - - if (domains == null || domains.length == 0) - { -%> -Error: no domain specified.
-<% - } - else - { - for (int i = 0; i < domains.length; i++) - { -%> -result <%= domains[i] %> = - <%= new CommandDomainDestroy(d, Integer.parseInt(domains[i]), - force).executeWeb() %>
-<% - } - } -%> - -
- - - - - diff --git a/tools/control/web/tmpl/dom-lis.tmpl b/tools/control/web/tmpl/dom-lis.tmpl deleted file mode 100644 index 5ff61e1ab3..0000000000 --- a/tools/control/web/tmpl/dom-lis.tmpl +++ /dev/null @@ -1,58 +0,0 @@ -Domain List -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- -<% - CommandDomainList list = new CommandDomainList(sc.getDefaults()); - String output = list.executeWeb(); - Domain domains[] = list.domains(); - if (output != null) - { -%> -<%= output %> -<% - } else { -%> - - - - - <% - /* assert: domains != null, otherwise, where is the servlet engine? */ - for (int loop = 0; loop < domains.length; loop++) - { - %> - - - - - - - - - - <% - } - %> - -
domain
id
processorhas
cpu
statemcu
advance
total
pages
name
<%= domains[loop].id %><%= domains[loop].processor %><%= domains[loop].cpu %> <%= domains[loop].state %> <%= domains[loop].mcu %> <%= domains[loop].pages %> <%= domains[loop].name %>
-<% - } -%> - -
- - - - - diff --git a/tools/control/web/tmpl/dom-new.tmpl b/tools/control/web/tmpl/dom-new.tmpl deleted file mode 100644 index 6025225e10..0000000000 --- a/tools/control/web/tmpl/dom-new.tmpl +++ /dev/null @@ -1,197 +0,0 @@ -Create New Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- -
- - - - - - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - -<% - Defaults d = sc.getDefaults(); - - if (d == null) - { -%> - ACK Defaults IS NULL -<% - } -%> - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - - - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - - - - - - -##WHITESPACE## - - - - - - - - - - - - - - - ##WHITESPACE## - - - - - - - - ##WHITESPACE## - - - - - - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - - - - - - - - - - - - - -##WHITESPACE## ##GREYLINE14## ##WHITESPACE## - - - - - - - -
Create A New Domain
Domain Name
-
Memory Size
- KB -
Kernel Image
path - -
IP Config
VIFs - -
IP address
Gateway
Netmask
Root File System
NFSpath - -
server - -
ramdiskpath - -
physical diskpath
virtual diskpath
Extra Arguments
-
- -
- - - - - diff --git a/tools/control/web/tmpl/dom-newr.tmpl b/tools/control/web/tmpl/dom-newr.tmpl deleted file mode 100644 index f762d3269a..0000000000 --- a/tools/control/web/tmpl/dom-newr.tmpl +++ /dev/null @@ -1,113 +0,0 @@ -Create New Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- -Create Domain Results -
- -<% - HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); - Defaults d = sc.getDefaults(); - String root_device = hsrw.getParameter("root"); - - String nfsroot = null; - String nfsserver = null; - String rd = null; - String disk = null; - - if (root_device.equals("nfs")) - { - nfsroot = hsrw.getParameter("nfsroot"); - nfsserver = hsrw.getParameter("nfsserver"); - disk = "/dev/nfs"; - } - else if (root_device.equals("ram")) - { - nfsserver = hsrw.getParameter("nfsserver"); - rd = hsrw.getParameter("rd"); - } - else if (root_device.equals("pdisk")) - { - nfsserver = hsrw.getParameter("nfsserver"); - disk = hsrw.getParameter("pdisk"); - } - else if (root_device.equals("vdisk")) - { - nfsserver = hsrw.getParameter("nfsserver"); - disk = hsrw.getParameter("vdisk"); - } - -%> -name = <%= hsrw.getParameter("name") %> -
-size = <%= hsrw.getParameter("size") %> -
-image = <%= hsrw.getParameter("image") %> -
-initrd = <%= rd %> -
-vifs = <%= hsrw.getParameter("vifs") %> -
-bargs = <%= hsrw.getParameter("args") %> -
-nfs_root_path = <%= nfsroot %> -
-nw_ip = <%= hsrw.getParameter("ip") %> -
-nw_gw = <%= hsrw.getParameter("gw") %> -
-nw_mask = <%= hsrw.getParameter("mask") %> -
-nw_nfs_server = <%= nfsserver %> -
-nw_host = <%= hsrw.getParameter("hostname") %> -
-root = <%= disk %> -
-output =
-<% - CommandDomainNew command_new = new CommandDomainNew(d, - hsrw.getParameter("name"), - Integer.parseInt(hsrw.getParameter("size")), - hsrw.getParameter("image"), - rd, - Integer.parseInt(hsrw.getParameter("vifs")), - hsrw.getParameter("args"), - disk, - nfsroot, - hsrw.getParameter("ip"), - hsrw.getParameter("gw"), - hsrw.getParameter("mask"), - nfsserver, - hsrw.getParameter("hostname")); - String oneline = command_new.executeWeb(); - if ( oneline != null ) { -%> -<%= oneline %>
-<% - } else { - String[] output = command_new.output(); - for (int i = 0; i < output.length; i++) { -%> -<%= output[i] %>
-<% - } - } -%> - -
- - - - - diff --git a/tools/control/web/tmpl/dom-sta.tmpl b/tools/control/web/tmpl/dom-sta.tmpl deleted file mode 100644 index 48fa3ca3be..0000000000 --- a/tools/control/web/tmpl/dom-sta.tmpl +++ /dev/null @@ -1,73 +0,0 @@ -Start Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- -
- - - -<% - } -%> - -##WHITESPACE## ##GREYLINE1## ##WHITESPACE## - - - - - -
-<% - CommandDomainList list = new CommandDomainList(sc.getDefaults()); - String output = list.executeWeb(); - Domain domains[] = list.domains(); - if (output != null) - { -%> -<%= output %> -<% - } else { -%> - - - - - <% - for (int loop = 0; loop < domains.length; loop++) - { - %> - - - - - - - - - - - <% - } - %> - - -
domain
id
processorhas
cpu
statemcu
advance
total
pages
name
<%= domains[loop].id %><%= domains[loop].processor %><%= domains[loop].cpu %> <%= domains[loop].state %> <%= domains[loop].mcu %> <%= domains[loop].pages %> <%= domains[loop].name %>
-
-
- -
- - - - - diff --git a/tools/control/web/tmpl/dom-star.tmpl b/tools/control/web/tmpl/dom-star.tmpl deleted file mode 100644 index b9110cfca8..0000000000 --- a/tools/control/web/tmpl/dom-star.tmpl +++ /dev/null @@ -1,48 +0,0 @@ -Start Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- - -Start Domain Results -
- -<% - HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); - Defaults d = sc.getDefaults(); - - String domains[] = hsrw.getParameterValues("dom"); - - if (domains == null || domains.length == 0) - { -%> -Error: no domain specified.
-<% - } - else - { - for (int i = 0; i < domains.length; i++) - { -%> -result <%= domains[i] %> = -<%= new CommandDomainStart(d, Integer.parseInt(domains[i])).executeWeb() %>
-<% - } - } -%> - -
- - - - - diff --git a/tools/control/web/tmpl/dom-stp.tmpl b/tools/control/web/tmpl/dom-stp.tmpl deleted file mode 100644 index 6e9b34989c..0000000000 --- a/tools/control/web/tmpl/dom-stp.tmpl +++ /dev/null @@ -1,73 +0,0 @@ -Stop Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- -
- - - -<% - } -%> - -##WHITESPACE## ##GREYLINE1## ##WHITESPACE## - - - - - -
-<% - CommandDomainList list = new CommandDomainList(sc.getDefaults()); - String output = list.executeWeb(); - Domain domains[] = list.domains(); - if (output != null) - { -%> -<%= output %> -<% - } else { -%> - - - - - <% - for (int loop = 0; loop < domains.length; loop++) - { - %> - - - - - - - - - - - <% - } - %> - - -
domain
id
processorhas
cpu
statemcu
advance
total
pages
name
<%= domains[loop].id %><%= domains[loop].processor %><%= domains[loop].cpu %> <%= domains[loop].state %> <%= domains[loop].mcu %> <%= domains[loop].pages %> <%= domains[loop].name %>
-
-
- -
- - - - - diff --git a/tools/control/web/tmpl/dom-stpr.tmpl b/tools/control/web/tmpl/dom-stpr.tmpl deleted file mode 100644 index 148afb83a1..0000000000 --- a/tools/control/web/tmpl/dom-stpr.tmpl +++ /dev/null @@ -1,48 +0,0 @@ -Stop Domain -SECTION&XenoServers -BREADCRUMB&Domain Manager&dom.jsp - - - - - - -INCLUDE&dommenu.tmpl - - -
- - -Stop Domain Results -
- -<% - HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); - Defaults d = sc.getDefaults(); - - String domains[] = hsrw.getParameterValues("dom"); - - if (domains == null || domains.length == 0) - { -%> -Error: no domain specified.
-<% - } - else - { - for (int i = 0; i < domains.length; i++) - { -%> -result <%= domains[i] %> = -<%= new CommandDomainStop(d, Integer.parseInt(domains[i])).executeWeb() %>
-<% - } - } -%> - -
- - - - - diff --git a/tools/control/web/tmpl/dom.tmpl b/tools/control/web/tmpl/dom.tmpl deleted file mode 100644 index f107cd5e10..0000000000 --- a/tools/control/web/tmpl/dom.tmpl +++ /dev/null @@ -1,30 +0,0 @@ -Domain Manager -SECTION&XenoServers - - - - - - -INCLUDE&dommenu.tmpl - - -
- - -<% - Defaults d = sc.getDefaults(); -%> - - - - -
Domain Manager
-
- - - - - diff --git a/tools/control/web/tmpl/dommenu.tmpl b/tools/control/web/tmpl/dommenu.tmpl deleted file mode 100644 index 8fc11b2276..0000000000 --- a/tools/control/web/tmpl/dommenu.tmpl +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
List
New
Start
Stop
Delete
- - - - - - - diff --git a/tools/control/web/tmpl/help.tmpl b/tools/control/web/tmpl/help.tmpl deleted file mode 100644 index 9cf6462273..0000000000 --- a/tools/control/web/tmpl/help.tmpl +++ /dev/null @@ -1,61 +0,0 @@ -Help -SECTION&XenoServers - - - - - - - - - - -
- - - - - - - - - - - - - -
-

-The XenoServer project aims to build a public infrastructure for wide-area distributed computing. -

-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- Help -
Some help text will go here. -
-
- diff --git a/tools/control/web/tmpl/index.tmpl b/tools/control/web/tmpl/index.tmpl deleted file mode 100644 index 594d87cb96..0000000000 --- a/tools/control/web/tmpl/index.tmpl +++ /dev/null @@ -1,67 +0,0 @@ -XenoServers -COPYRIGHT&Computer Laboratory, University of Cambridge - - - - - - - - - - -
- - - - - - - - - - - - - - -
-

- The XenoServer project aims to build a public infrastructure - for wide-area distributed computing. -

-
- - - - - - - - -##WHITESPACE## ##GREYLINE1## ##WHITESPACE## - - - - - -##WHITESPACE## ##GREYLINE1## ##WHITESPACE## - - - - - - -##WHITESPACE## -
- About the XenoServers Project
-
- Domain Manager
- Virtual Disk Manager
- Physical Disk Manager
-
- For additional information, click - here -
-
- diff --git a/tools/control/web/tmpl/install.pl b/tools/control/web/tmpl/install.pl deleted file mode 100755 index 1d712a2e39..0000000000 --- a/tools/control/web/tmpl/install.pl +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/perl5 -if($#ARGV<0) { - &usage(); -} else { - - $headerfile = "xenohead.def" ; - $footerfile = "xenofoot.def" ; - - $sectionbreak = "-" ; - $supress_section = 0 ; - $homepage = 0 ; - $navigationwidth = 106; - $navigationstring = "\"XenoServers"; - $whitespace = ""; - $greyline1 = ""; - $greyline2 = ""; - $greyline3 = ""; - $greyline4 = ""; - $greyline14 = ""; - - - $login = getlogin || (getpwuid($<))[0] || "an unidentified user" ; - - $name =`finger $login | sed -n "s/Login.*:.*: //p"` ; - if( $name eq "" ) { $name = $login ; } - - $date = `date +"on %-e-%b-%Y at %H:%M"` ; - - $year = `date +"%Y"` ; - - foreach $ag (@ARGV) { - - if( $ag =~ "^-s" ) { - $supress_section = 1 ; - } - elsif( $ag =~ "^-home" ) { - $homepage = 1 ; - } - else { - - $preagtmp = $ag . ".tmpl~$$"; - $agtmp = $ag . ".jsp~$$"; - - open(PRETMPL,">$preagtmp") or die "Unable to write $preagtmp\n"; - print PRETMPL &doIncludes("$ag.tmpl"); - close(PRETMPL); - - open(TMPL,"<$preagtmp") or die "Unable to read $preagtmp\n"; - - open(HTML,">$agtmp") or die "Unable to open $agtmp\n" ; - - $title= ; - - $sectionhead = "XenoServers" ; - $copyright = "Computer Laboratory, University of Cambridge" ; - $breadcrumbline = "" ; - $commentcontact="pagemaster\@cl.cam.ac.uk" ; - - $process_headings = 1 ; - $tmp= ; - while( $process_headings ) { - $process_headings = 0 ; - - if( $tmp =~ /^SECTION&(.*)$/ ) { - $sectionhead=$1 ; - $process_headings = 1 ; - } - - if( $tmp =~ /^COMMENTS&(.*)$/ ) { - $commentcontact=$1 ; - $process_headings = 1 ; - } - - if( $tmp =~ /^COPYRIGHT&(.*)$/ ) { - $copyright=$1 ; - $process_headings = 1 ; - } - - if( $tmp =~ /^HEADERFILE&(.*)$/ ) { - $headerfile=$1 ; - $process_headings = 1 ; - } - - if( $tmp =~ /^FOOTERFILE&(.*)$/ ) { - $footerfile=$1 ; - $process_headings = 1 ; - } - - if( $tmp =~ /BREADCRUMB&.*/ ) { - @bread=split(/&/,$tmp) ; - @bwords=split(/ /, @bread[1]) ; - $bname=@bwords[0] ; - for( $i=1 ; $i <= $#bwords ; $i++ ){ - $bname = $bname . " " . @bwords[$i] ; - } - $breadcrumbline = $breadcrumbline . " > " . $bname . "" ; - $process_headings = 1 ; - } - - if( $process_headings ) { - $tmp= ; - } - } - -#### generate the final breadcrumb which is the current file itself - @path=split(/\//, $ag) ; - $localfilename=@path[$#path] . ".jsp" ; - @bwords=split(/ /, $title) ; - $bname=@bwords[0] ; - for( $i=1 ; $i <= $#bwords ; $i++ ){ - $bname = $bname . " " . @bwords[$i] ; - } - $breadcrumbline = $breadcrumbline . " > " . $bname . "" ; - - -#### if suppressing the section header then do so now - if( $supress_section ) { - $sectionhead = "" ; - $sectionbreak = "" ; - } - -#### if homepage then do so now - if( $homepage ) { - $breadcrumbline = "" ; - $navigationwidth = 53; - $navigationstring = ""; - } - - - open(HEADER,"<$headerfile") or die "Unable to open $headerfile\n" ; - while(
) { - s/##TITLE##/$title/g ; - s/##SECTION##/$sectionhead/g ; - s/##SECTIONBREAK##/$sectionbreak/g ; - s/##BREADCRUMBS##/$breadcrumbline/g ; - s/##FILENAME##/$ag.jsp/g ; - s/##DATE##/$date/g ; - s/##OWNERNAME##/$name/g ; - s/##OWNERUSERID##/$login/g ; - s/##OWNEREMAIL##/$login\@cl.cam.ac.uk/g ; - s/##COMMENTCONTACT##/$commentcontact/g ; - s/##COPYRIGHT##/$copyright/g ; - s/##YEAR##/$year/g ; - s/##NAVIGATIONWIDTH##/$navigationwidth/g ; - s/##NAVIGATIONSTRING##/$navigationstring/g ; - print HTML $_ ; - } - close(HEADER) ; - - $_ = $tmp ; - while(defined($_)) { - s/##LISTSTART##/
    /g ; - s/##ITEMHEAD##/
  • /g ; - s/##ITEMBODY##/
    /g ; - s|##LISTEND##|
|g ; - s/##TITLE##/$title/g ; - s/##SECTION##/$sectionhead/g ; - s/##BREADCRUMBS##/$breadcrumbline/g ; - s/##FILENAME##/$ag.jsp/g ; - s/##DATE##/$date/g ; - s/##OWNERNAME##/$name/g ; - s/##OWNERUSERID##/$login/g ; - s/##OWNEREMAIL##/$login\@cl.cam.ac.uk/g ; - s/##COMMENTCONTACT##/$commentcontact/g ; - s/##COPYRIGHT##/$copyright/g ; - s/##YEAR##/$year/g ; - s/##WHITESPACE##/$whitespace/g ; - s/##GREYLINE1##/$greyline1/g ; - s/##GREYLINE2##/$greyline2/g ; - s/##GREYLINE3##/$greyline3/g ; - s/##GREYLINE4##/$greyline4/g ; - s/##GREYLINE14##/$greyline14/g ; - print HTML $_ ; - $_ = - } - open(FOOTER,"<$footerfile") or die "Unable to open $footerfile\n" ; - while(